{"bugs":{"url":"https://github.com/ipfs/js-ipfs/issues"},"dist":{"shasum":"b6c7b03f3b8dfda19b1047904972ef63939525a9","tarball":"https://registry.npmjs.org/ipfs-http-response/-/ipfs-http-response-6.0.0-3bcabe38.tgz","fileCount":21,"integrity":"sha512-SDT4zfsUet2GjDieZdwT5F2WFWBaD8id5Rm2YbQKke+w1eE+upQ1iD0NC4lSkR3ijus/DySqwqQJeTc6YYmfPQ==","signatures":[{"sig":"MEQCIE6cp2tGHYFoUsIj5FTokxc8AJRcuebUJiBWUWH04gYkAiANiAZ7K7wNGSZhQXZl36ILgejfwhnm18UAzzUFcPuZvg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":226723,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjxr9kACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqJBRAAnqj5WHbua0aYWjdTzhHgS/8pecVNjtz4QF/PknQbV0BSicoJ\r\nRO5rD8q3y8qLEnOUQUk/jujhqMUpbJRfxbbKPYn+DqGwGQWi4YXrYOjE+ObT\r\nz0FH2ta2i6Lq6lopzdCIjjZnoW+3xnuLmyRkl7pzFA4t4XUzhkoJfjqds50Y\r\ng/FFTDFSuxSo3OBy8609p04HjxYAiLakfTmfkIzgA1gX+UPAk4BToEADcDiH\r\nbLPyIMtl0XUv89+GAGf/GjDenB0Ne2YG1MvfQHP9/PHBW8xEULrmDb4EA6tx\r\nyLXn0i++x758PFxiQZ76+xNUUymMQKkFHfgLCLnjuB55lNDoMlLLxNycXHkF\r\n234H6CotUC5JmInFn/nqeTGg40bxPbZwburRuorls3FJ7fPPGkEYKimJOpcE\r\nyBIiNPeNbbyissne6/YA90AWL8oNOIihY9eJO6bI2qTrqKaPD1qeoqWJuaw+\r\necKtWRVkeHl6YryYcbz1x/ejI3jhbxfjx8Gm9ZpX9rS/4irJunsL/LFl140X\r\n8Rf444ljlN7quZePM8+dehD5nfY8tD0VzDcfkidfJ5RdPfpMABRM65xzBp8q\r\nj1OMo3GtjAHmz+Go2JlfZmD6hX9LBUZAb+VKVAYfK1K5Ux/SoqYKPhHOJMGX\r\nPpXJ7GzSDARW6ekbQpXSU+Mumo6JGYs54Xs=\r\n=DwtD\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.tech](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](https://ipfs.tech)\n[![Discuss](https://img.shields.io/discourse/https/discuss.ipfs.tech/posts.svg?style=flat-square)](https://discuss.ipfs.tech)\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/actions/workflow/status/ipfs/js-ipfs/test.yml?branch=master\\&style=flat-square)](https://github.com/ipfs/js-ipfs/actions/workflows/test.yml?query=branch%3Amaster)\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":"3bcabe3818ce8bbbafe0cbb68749b286d8a7edd9","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":"8.19.3","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":"18.13.0","dependencies":{"ejs":"^3.1.6","it-map":"^2.0.0","filesize":"^10.0.5","file-type":"^18.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.5"},"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.11.0","it-all":"^2.0.0","ipfs-core":"0.18.0-3bcabe38","ipfsd-ctl":"^13.0.0","@types/ejs":"^3.1.0","get-stream":"^6.0.0","uint8arrays":"^4.0.2","@types/mime-types":"^2.1.1"},"_npmOperationalInternal":{"tmp":"tmp/ipfs-http-response_6.0.0-3bcabe38_1673969507742_0.9075856939978051","host":"s3://npm-registry-packages"},"_id":"ipfs-http-response@6.0.0-3bcabe38","version":"6.0.0-3bcabe38"}