{"_id":"@dorgjelli-test/ipfs-http-client-lite","_rev":"1-aaf1aa5342a4e85595ec4da69614692f","name":"@dorgjelli-test/ipfs-http-client-lite","dist-tags":{"latest":"0.3.1"},"versions":{"0.3.1":{"name":"@dorgjelli-test/ipfs-http-client-lite","version":"0.3.1","description":"A client library for the IPFS HTTP API","leadMaintainer":"Alan Shaw <alan.shaw@protocol.ai>","main":"src/index.js","browser":{"./src/lib/configure.js":"./src/lib/configure.browser.js","./src/add/form-data.js":"./src/add/form-data.browser.js","./src/files/write/form-data.js":"./src/files/write/form-data.browser.js"},"browserslist":">1.5% or node >=10 and not ios_saf <13 and not ie 11 and not dead","scripts":{"test":"aegir test","test:node":"aegir test -t node","test:browser":"aegir test -t browser","test:webworker":"aegir test -t webworker","lint":"aegir lint","build":"aegir build","release":"aegir release --no-docs","release-minor":"aegir release --type minor --no-docs","release-major":"aegir release --type major --no-docs","coverage":"npx nyc -r html npm run test:node -- --bail"},"dependencies":{"abort-controller":"^3.0.0","async-iterator-to-pull-stream":"^1.3.0","buffer":"^5.2.1","cids":"^0.7.1","explain-error":"^1.0.4","form-data":"^2.4.0","iterable-ndjson":"^1.1.0","node-fetch":"^2.6.0","pull-stream-to-async-iterator":"^1.0.2","querystring":"^0.2.0"},"devDependencies":{"aegir":"^19.0.4","bignumber.js":"^9.0.0","chai":"^4.2.0","dirty-chai":"^2.0.1","go-ipfs-dep":"^0.4.21","interface-ipfs-core":"~0.105.1","ipfs-block":"^0.8.1","ipfsd-ctl":"^0.43.0","multiaddr":"^6.1.0","multiaddr-to-uri":"^4.0.1","multihashes":"^0.4.14","peer-id":"^0.12.2","pull-stream":"^3.6.12"},"engines":{"node":">=10.0.0","npm":">=5.6.0"},"repository":{"type":"git","url":"git+https://github.com/ipfs-shipyard/js-ipfs-http-client-lite.git"},"keywords":["ipfs","http","api","client","rpc","rest"],"license":"(Apache-2.0 OR MIT)","bugs":{"url":"https://github.com/ipfs-shipyard/js-ipfs-http-client-lite/issues"},"homepage":"https://github.com/ipfs-shipyard/js-ipfs-http-client-lite","contributors":[{"name":"Alan Shaw","email":"alan.shaw@protocol.ai"}],"gitHead":"20ee09bc80c65d76689d671116a5499bd657b547","_id":"@dorgjelli-test/ipfs-http-client-lite@0.3.1","_nodeVersion":"14.16.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-N96ilOlJnjnprOOIrwKjEA7lu67mbXyGmJO/vOBXQvY9AQw9XrPdIEn0x30bHwQ6pWSwN4RhIgJUy1/A7u/hEg==","shasum":"5514b4400e0c91ea64e0b5faf426ba808809ddfe","tarball":"https://registry.npmjs.org/@dorgjelli-test/ipfs-http-client-lite/-/ipfs-http-client-lite-0.3.1.tgz","fileCount":47,"unpackedSize":551857,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdvmpCRA9TVsSAnZWagAAeuYP/jmVdFHK/XG/YXWdlDd3\nOr/K9cjpu0hbKZPlsutVwZIcRSXD9Q83htP6uvgxPPfHdSL+YVWmh/XeW2V9\np2XNp+HIwuAxm/sgY8PXPu8r9gQfJkeII/2DjP2pbnjS9nhtVnrIjEaaqDn5\nrVmUsr64onA8orHTnO1VPcCaALB9Z883HMdQLwV0vVQtexhw97sqom0jNYLz\nd0jj6EnJErwsT4d4ydcdzf3MS/TdZ3ukg2XEulWwLG5fMvecUAMZf33Xv0Lt\nkMIGiOTDqc2skO4VWWBXzW2s1lpYLhA95F74PAJIW4x6XvpMtzokoE1EDJVD\nHXb4KTtDmuqQMOsAdqEVvfRUKUYjPx6DlzPjzXwWtM5Ed0vD6yXRM7eEiAQH\nraoduPw6BJIYHtvNVFLI5me9TplTy4ZdXe2dvEYlLLXS6xNddIcLM+bCY9pP\nTYQa/pS6ixf67YhBLtYYAzJ8idYJW6A2WKtnaP+vmTLTUUu6FBq93YOlS9N9\nLt5v3qnLjqwxJI25A9Z1y9iekrRfTccGYTjFp7AP0KI/ODfP8Ix5v2BYj+Al\njYOaS5TR4xM+ebAjETzdp0RAqMN//MwkYS3UBHrf+JEjvY76lLng1qTR30P+\nBr2DmIlUwtowRFv2C016mArYhSMFX4d2xgUAZeFyMyPOndECSaz7dvHZWLvQ\njaH7\r\n=ZeG5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDauZ8TjALYbHmJSKx6Cyx4ZWysEbbVW6+hnNtLWmfGGgIgbhbuIXaEp4mhyaJTz420Rvp3AxPFKaWuHGM64Hh8xUg="}]},"_npmUser":{"name":"dorgjelli","email":"jelli@dorg.tech"},"directories":{},"maintainers":[{"name":"web3-api-build-bot","email":"admin@web3api.dev"},{"name":"dorgjelli","email":"jelli@dorg.tech"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ipfs-http-client-lite_0.3.1_1618409897182_0.7295302105628856"},"_hasShrinkwrap":false}},"time":{"created":"2021-04-14T14:18:16.943Z","0.3.1":"2021-04-14T14:18:17.306Z","modified":"2022-04-05T05:26:42.975Z"},"maintainers":[{"name":"web3-api-build-bot","email":"admin@web3api.dev"},{"name":"dorgjelli","email":"jelli@dorg.tech"}],"description":"A client library for the IPFS HTTP API","homepage":"https://github.com/ipfs-shipyard/js-ipfs-http-client-lite","keywords":["ipfs","http","api","client","rpc","rest"],"repository":{"type":"git","url":"git+https://github.com/ipfs-shipyard/js-ipfs-http-client-lite.git"},"contributors":[{"name":"Alan Shaw","email":"alan.shaw@protocol.ai"}],"bugs":{"url":"https://github.com/ipfs-shipyard/js-ipfs-http-client-lite/issues"},"license":"(Apache-2.0 OR MIT)","readme":"<h1 align=\"center\">\n  <a href=\"https://ipfs.io\"><img width=\"720\" src=\"https://ipfs.io/ipfs/QmdPAhQRxrDKqkGPvQzBvjYe3kU8kiEEAd2J6ETEamKAD9\" alt=\"IPFS HTTP client LITE logo\" /></a>\n</h1>\n\n<h3 align=\"center\">A lightweight JavaScript HTTP client library for IPFS.</h3>\n\n> An alternative client library for the IPFS HTTP API, aiming to be as lightweight as possible (<20KB) in the browser.\n\n## Lead Maintainer\n\n[Alan Shaw](http://github.com/alanshaw).\n\n## Table of Contents\n\n- [Install](#install)\n- [Usage](#usage)\n  - [Running the daemon with the right port](#running-the-daemon-with-the-right-port)\n  - [CORS](#cors)\n  - [Custom HTTP Headers](#custom-http-headers)\n  - [Importing](#importing)\n  - [API Docs](#api)\n- [Contribute](#contribute)\n- [License](#license)\n\n## Install\n\nThis module requires Node.js and npm to install:\n\n```sh\nnpm install --save ipfs-http-client-lite\n```\n\nWe support both the Current and Active LTS versions of Node.js. Please see [nodejs.org](https://nodejs.org/) for what these currently are.\n\n## Usage\n\n### Running the daemon with the right port\n\nTo interact with the API, you need to have a local daemon running. It needs to be open on the right port. `5001` is the default, and is used in the examples below, but it can be set to whatever you need.\n\n```sh\n# Show the ipfs config API port to check it is correct\n> ipfs config Addresses.API\n/ip4/127.0.0.1/tcp/5001\n# Set it if it does not match the above output\n> ipfs config Addresses.API /ip4/127.0.0.1/tcp/5001\n# Restart the daemon after changing the config\n\n# Run the daemon\n> ipfs daemon\n```\n\n### CORS\n\nIn a web browser IPFS HTTP client (either browserified or CDN-based) might encounter an error saying that the origin is not allowed. This would be a CORS (\"Cross Origin Resource Sharing\") failure: IPFS servers are designed to reject requests from unknown domains by default. You can whitelist the domain that you are calling from by changing your ipfs config like this:\n\n```console\n$ ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin  '[\"http://example.com\"]'\n$ ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '[\"PUT\", \"POST\", \"GET\"]'\n```\n\n### Custom HTTP Headers\n\nIf you wish to send custom headers with each request made by this library, for example, the Authorization header. You can use the config to do so:\n\n```js\nconst ipfs = IpfsHttpClientLite({\n  apiUrl: 'http://localhost:5001',\n  headers: {\n    Authorization: 'Bearer ' + TOKEN\n  }\n})\n```\n\n### Importing\n\n```js\nconst IpfsHttpClientLite = require('ipfs-http-client-lite')\n\n// Connect to ipfs daemon HTTP API server\nconst ipfs = IpfsHttpClientLite('http://localhost:5001')\n// Note: leaving out the argument will default to this value\n```\n\nFor ultra small bundle size, import just the methods you need. e.g.\n\n```js\nconst cat = require('ipfs-http-client-lite/src/cat')('http://localhost:5001')\nconst data = await cat('QmQeEyDPA47GqnduyVVWNdnj6UBPXYPVWogAQoqmAcLx6y')\n```\n\n#### In a web browser\n\n**Bundling**\n\nThis module can be bundled with webpack and browserify and should be compatible with most other bundlers.\n\n**CDN**\n\nInstead of a local installation (and bundling) you may request a remote copy of the IPFS HTTP API client from [unpkg CDN](https://unpkg.com/).\n\nTo always request the latest version, use the following:\n\n```html\n<script src=\"https://unpkg.com/ipfs-http-client-lite/dist/index.min.js\"></script>\n```\n\nYou can also use the un-minified version, just remove \".min\" from the URL.\n\nFor maximum security you may also decide to:\n\n* Reference a specific version of the IPFS HTTP API client (to prevent unexpected breaking changes when a newer latest version is published)\n* [Generate a SRI hash](https://www.srihash.org/) of that version and use it to ensure integrity\n* Set the [CORS settings attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes) to make anonymous requests to CDN\n\nExample:\n\n```html\n<script src=\"https://unpkg.com/ipfs-http-client-lite@1.0.0/dist/index.js\"\nintegrity=\"sha384-5bXRcW9kyxxnSMbOoHzraqa7Z0PQWIao+cgeg327zit1hz5LZCEbIMx/LWKPReuB\"\ncrossorigin=\"anonymous\"></script>\n```\n\nThe CDN-based IPFS HTTP API provides the `IpfsHttpClientLite` constructor as a property of the global `window` object. Example:\n\n```js\nconst ipfs = window.IpfsHttpClientLite('http://localhost:5001')\n```\n\nIf you omit the URL, the client will parse `window.location.host`, and use this information. This also works, and can be useful if you want to write apps that can be run from multiple different gateways:\n\n```js\nconst ipfs = window.IpfsHttpClientLite()\n```\n\n### API\n\nThis module is in heavy development, not all API methods are available (or documented) yet!\n\n* [IpfsHttpClientLite](./API.md#ipfshttpclientlite)\n* [add](./API.md#add)\n* addFromFs\n* [addFromStream](./API.md#addfromstream) TODO: add docs\n* [addFromURL](./API.md#addfromurl) TODO: add docs\n* [addPullStream](./API.md#addpullstream)\n* [bitswap.stat](./API.md#bitswapstat) TODO: add docs\n* [bitswap.wantlist](./API.md#bitswapwantlist) TODO: add docs\n* [block.get](./API.md#blockget)\n* [block.put](./API.md#blockput)\n* [block.stat](./API.md#blockstat)\n* bootstrap.add\n* bootstrap.list\n* bootstrap.rm\n* [cat](./API.md#cat)\n* [catPullStream](./API.md#catpullstream) TODO: add docs\n* config.get\n* config.replace\n* config.set\n* dag.get\n* dag.put\n* dag.tree\n* dht.findPeer\n* dht.findProvs\n* dht.get\n* dht.provide\n* dht.put\n* dht.query\n* dns\n* [files.cp](./API.md#filescp)\n* files.flush\n* files.ls\n* files.lsPullStream\n* [files.mkdir](./API.md#filesmkdir)\n* files.mv\n* files.read\n* files.readPullStream\n* files.rm\n* files.stat\n* [files.write](./API.md#fileswrite)\n* [id](./API.md#id) TODO: add docs\n* key.export\n* key.gen\n* key.import\n* key.list\n* key.rename\n* key.rm\n* [ls](./API.md#ls) TODO: add docs\n* [lsPullStream](./API.md#lspullstream) TODO: add docs\n* name.pubsub.cancel\n* name.pubsub.state\n* name.pubsub.subs\n* object.data\n* object.get\n* object.links\n* object.new\n* object.patch.addLink\n* object.patch.appendData\n* object.patch.rmLink\n* object.patch.setData\n* object.put\n* pin.add\n* pin.ls\n* pin.rm\n* [ping](./API.md#ping) TODO: add docs\n* [pingPullStream](./API.md#pingpullstream) TODO: add docs\n* [pubsub.ls](./API.md#pubsubls)\n* [pubsub.peers](./API.md#pubsubpeers)\n* [pubsub.publish](./API.md#pubsubpublish)\n* [pubsub.subscribe](./API.md#pubsubsubscribe)\n* [pubsub.unsubscribe](./API.md#pubsubunsubscribe)\n* refs\n* refsPullStream\n* refs.local\n* refs.localPullStream\n* repo.gc\n* repo.stat\n* repo.version\n* resolve\n* shutdown\n* stats.bitswap\n* stats.bw\n* stats.bwPullStream\n* stats.repo\n* swarm.addrs\n* [swarm.connect](./API.md#swarmconnect)\n* swarm.disconnect\n* swarm.localAddrs\n* [swarm.peers](./API.md#swarmpeers)\n* [version](./API.md#version) TODO: add docs\n\nNote: All API methods are documented using Promises/async/await but they also accept a callback as their last parameter.\n\n### Testing\n\nWe run tests by executing `npm test` in a terminal window. This will run both Node.js and Browser tests, both in Chrome and PhantomJS. To ensure that the module conforms with the [`interface-ipfs-core`](https://github.com/ipfs/interface-ipfs-core) spec, we run the batch of tests provided by the interface module, which can be found [here](https://github.com/ipfs/interface-ipfs-core/tree/master/js/src).\n\n## Contribute\n\nFeel free to dive in! [Open an issue](https://github.com/ipfs-shipyard/js-ipfs-http-client-lite/issues/new) or submit PRs.\n\n**Want to hack on IPFS?**\n\n[![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md)\n\n## License\n\nDual-licensed under Apache 2.0 and MIT terms:\n- Apache License, Version 2.0, ([LICENSE-APACHE](https://github.com/ipfs-shipyard/js-ipfs-http-client-lite/blob/master/LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)\n- MIT license ([LICENSE-MIT](https://github.com/ipfs-shipyard/js-ipfs-http-client-lite/blob/master/LICENSE-MIT) or http://opensource.org/licenses/MIT)\n","readmeFilename":"README.md"}