{"bugs":{"url":"https://github.com/ipfs/js-ipfs/issues"},"dist":{"shasum":"ab1421c838f9feb815245c3206cc374ee8c5d4ad","tarball":"https://registry.npmjs.org/ipfs-http-response/-/ipfs-http-response-4.0.2-dfc43d4e.0.tgz","fileCount":21,"integrity":"sha512-g5djhYow4xRXv1SMN3vGDcCFw1vDzR5+qtHlecIevRervnJOBCycJwA7Yz+v8Ih45gL1JO7N+cBqT2hd943HkA==","signatures":[{"sig":"MEUCIQDiuj26ZE9It4tDRjX7ljujG5SFXO2MuwW0Uj3snVYfJwIgYRzhuKU+MEgxJ2CB7B0s2DTCf4r0vAOAw3FYmniOY1s=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":227458,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjMbUqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoLGA/8CLcCV0N7BY2Ny7hh6zXqMOi+4Emkv41aqPNRNX2KIKdXOyfj\r\nF7L1MarZI1TLrwNPymveP8NAHS1R+S40K/SjsJdxYL7I2SHvZ28dp8VS2o9x\r\nhmDBBkqgyahsPOQx/KhWkTAyMXpBiEukcRzbCSb5Yi1phjCQYW3g7gdSa2w4\r\nzbaC2SQgV+2G4eTJGRnIX1hl8KQnM24IA2F/yrFrJ+Waaix1uyYElVI6CkPy\r\nyb4MLKtNfu5zGfS103QgxxSclCxRFomtHmkvsctMDLa+2CHMtVHZOhalVTw3\r\nCsv3jA3gR2C0pJGvkubH0AFG/g+Q0ImKgAeEOvhVtpPdi2AW1MOAbgl5mnZz\r\n5cKkYu9TWGloCsi7JwOMJnCPjqOOLS4RRdLx5XcmIfXBqzzWjzfxSGblgpew\r\neqDEvaERV5h9KDCGO+ZmD5sbCWStxJgkKgQcEReIBQA5/lP7yXIHX5EAqDab\r\nPpkAHSUdRm5V+l+SuSX686zOO7wV6E7xpJM6ufvROT2I48PxJjD8BpCa7zvi\r\nujodgWYebv6iib5cpyONGEV97N5WUy3JGdDPUOHIqBZA13W0Sbd9O1nLKnEn\r\niQ0ncdRXnrrgXpDnEHJ7JS6Cou4Rqa+qyawHz+Diwu0X2QbPkF3dXkZGxkht\r\nU04KbmNfQKwCj0kn8di0qDvNFbrTsXqJvVc=\r\n=laLH\r\n-----END PGP SIGNATURE-----\r\n"},"name":"ipfs-http-response","type":"module","types":"./dist/src/index.d.ts","author":{"name":"Vasco Santos","email":"vasco.santos@moxy.studio"},"readme":"# ipfs-http-response <!-- omit in toc -->\n\n[![ipfs.io](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](http://ipfs.io)\n[![IRC](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs)\n[![Discord](https://img.shields.io/discord/806902334369824788?style=flat-square)](https://discord.gg/ipfs)\n[![codecov](https://img.shields.io/codecov/c/github/ipfs/js-ipfs.svg?style=flat-square)](https://codecov.io/gh/ipfs/js-ipfs)\n[![CI](https://img.shields.io/github/workflow/status/ipfs/js-ipfs/test%20&%20maybe%20release/master?style=flat-square)](https://github.com/ipfs/js-ipfs/actions/workflows/js-test-and-release.yml)\n\n> Creates an HTTP response from an IPFS Hash\n\n## Table of contents <!-- omit in toc -->\n\n- [Install](#install)\n- [Usage](#usage)\n  - [Creating HTTP Response](#creating-http-response)\n  - [Using protocol-agnostic resolver](#using-protocol-agnostic-resolver)\n- [License](#license)\n- [Contribute](#contribute)\n\n## Install\n\n```console\n$ npm i ipfs-http-response\n```\n\n## Usage\n\n### Creating HTTP Response\n\nThis project creates a HTTP response for an IPFS Path. This response can be a file, a HTML with directory listing or the entry point of a web page.\n\n```js\nimport { getResponse } from 'ipfs-http-response'\n\nconst result = await getResponse(ipfsNode, ipfsPath)\nconsole.log(result)\n```\n\n### Using protocol-agnostic resolver\n\nThis module also exports the used ipfs `resolver`, which should be used when the response needs to be customized or non-HTTP transport is used:\n\n```js\nimport { resolver } from 'ipfs-http-response'\n\nconst result = await resolver.cid(ipfsNode, ipfsPath)\nconsole.log(result)\n```\n\nIf `ipfsPath` points at a directory, `resolver.cid` will throw Error `This dag node is a directory` with a `cid` attribute that can be passed to `resolver.directory`:\n\n```js\nimport { resolver } from 'ipfs-http-response'\n\nconst result = await resolver.directory(ipfsNode, ipfsPath, cid)\nconsole.log(result)\n```\n\n`result` will be either a `string` with HTML directory listing or an array with CIDs of `index` pages present in inspected directory.\n\n![ipfs-http-response usage](docs/ipfs-http-response.png \"ipfs-http-response usage\")\n\n## License\n\nLicensed under either of\n\n- Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)\n- MIT ([LICENSE-MIT](LICENSE-MIT) / <http://opensource.org/licenses/MIT>)\n\n## Contribute\n\nContributions welcome! Please check out [the issues](https://github.com/ipfs/js-ipfs/issues).\n\nAlso see our [contributing document](https://github.com/ipfs/community/blob/master/CONTRIBUTING_JS.md) for more information on how we work, and about contributing in general.\n\nPlease be aware that all interactions related to this repo are subject to the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md).\n\nUnless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.\n\n[![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md)\n","browser":{"fs":false,"file-type":"file-type/browser"},"engines":{"npm":">=7.0.0","node":">=16.0.0"},"exports":{".":{"types":"./dist/src/index.d.ts","import":"./src/index.js"}},"gitHead":"4eac92ae987d3ba6007c4742456913c865a06857","license":"Apache-2.0 OR MIT","scripts":{"lint":"aegir lint","test":"aegir test -t node","build":"aegir build --no-bundle","clean":"aegir clean","dep-check":"aegir dep-check -i global","test:node":"aegir test -t node --cov"},"_npmUser":{"name":"npm-service-account-ipfs","email":"npm-service-account+ipfs@protocol.ai"},"homepage":"https://github.com/ipfs/js-ipfs/tree/master/packages/ipfs-http-response#readme","keywords":["http","ipfs","response"],"deprecated":"js-IPFS has been deprecated in favour of Helia - please see https://github.com/ipfs/js-ipfs/issues/4336 for details","repository":{"url":"git+https://github.com/ipfs/js-ipfs.git","type":"git"},"_npmVersion":"lerna/5.5.2/node@v16.17.0+x64 (linux)","description":"Creates an HTTP response from an IPFS Hash","directories":{},"maintainers":[{"name":"achingbrain","email":"alex@achingbrain.net"},{"name":"vascosantos","email":"santos.vasco10@gmail.com"},{"name":"ipfs-npm-publisher-bot","email":"alex.potsides+ipfs-npm-publisher-bot@protocol.ai"},{"name":"npm-service-account-ipfs","email":"npm-service-account+ipfs@protocol.ai"}],"_nodeVersion":"16.17.0","dependencies":{"ejs":"^3.1.6","it-map":"^1.0.6","filesize":"^9.0.11","file-type":"^17.1.1","it-buffer":"^0.1.1","it-concat":"^2.0.0","it-reader":"^6.0.1","mime-types":"^2.1.30","p-try-each":"^1.0.1","it-to-stream":"^1.0.0","@libp2p/logger":"^2.0.0"},"eslintConfig":{"extends":"ipfs","parserOptions":{"sourceType":"module"}},"typesVersions":{"*":{"*":["*","dist/*","dist/src/*","dist/src/*/index"],"src/*":["*","dist/*","dist/src/*","dist/src/*/index"]}},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"aegir":"^37.0.11","it-all":"^1.0.4","ipfs-core":"^0.16.2-dfc43d4e.0","ipfsd-ctl":"^12.0.3","@types/ejs":"^3.1.0","get-stream":"^6.0.0","uint8arrays":"^3.0.0","@types/mime-types":"^2.1.1"},"_npmOperationalInternal":{"tmp":"tmp/ipfs-http-response_4.0.2-dfc43d4e.0_1664202026205_0.2967844035041052","host":"s3://npm-registry-packages"},"_id":"ipfs-http-response@4.0.2-dfc43d4e.0","version":"4.0.2-dfc43d4e.0"}