JSPM

ipfs-http-response

0.1.4
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 6812
  • Score
    100M100P100Q9730F
  • License MIT

Creates an HTTP response from an IPFS Hash

Package Exports

  • ipfs-http-response
  • ipfs-http-response/src/utils/content-type

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ipfs-http-response) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

js-ipfs-http-response

standard-readme js-standard-style

Creates an HTTP response from an IPFS Hash

Lead Maintainer

Vasco Santos.

Installation

npm install ipfs-http-response

Usage

This project consists on creating a HTTP response from an IPFS Hash. This response can be a file, a directory list view or the entry point of a web page.

const { getResponse } = require('ipfs-http-response')

getResponse(ipfsNode, ipfsPath)
  .then((result) => {
    ...
  })

This module also exports the used ipfs resolver, which should be used when the response needs to be customized.

const { resolver } = require('ipfs-http-response')

resolver.multihash(ipfsNode, ipfsPath)
  .then((result) => {
    ...
  })
const { resolver } = require('ipfs-http-response')

resolver.directory(node, path, multihash)
  .then((result) => {
    ...
  })

ipfs-http-response usage