Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

chunk-fetch

Package Overview
Dependencies
Maintainers
1
Versions
108
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chunk-fetch

Use the same `fetch()` API browsers provide for HTTP, but for IPFS

  • 25.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-95.56%
Maintainers
1
Weekly downloads
 
Created
Source

chunk-fetch

example of how a url looks like using chunk-fetch ipfs://someCidAsHostname/some/path

_ - hostname is ignored, url will start with the path and the path becomes the query, so ipfs://_/somepath becomes ipfs://somepath CID - a CID that is used for the query

method: HEAD - does not return a body, only returns headers
hostname:

  • _ - ignores the hostname, path becomes the query
    path:
    • /path/to/dir/or/file - it can be any path including /, this path is the query that will be used with ipfs headers:
      • X-Copy - true | false - if true, a directory will be created with the CID, the data will be stored inside that directory. if false, the data will be stored using the path but without the new directory.
      • X-Timer - String - a number for a timeout
  • CID - a CID identifier for some data path:
    • / - used for a directory,if the CID is a directory
      headers:
      • X-Copy - true | false - if true, a directory will be created with the CID, the data will be stored inside that directory. if false, the data will be stored using the path but without the new directory.
      • X-Timer - String - a number for a timeout
    • /path/to/file - used for a file, if the CID is a file headers:
      • X-Copy - true | false - if true, a directory will be created with the CID, the data will be stored inside that directory. if false, the data will be stored using the path but without the new directory.
      • X-Timer - String - a number for a timeout

method: GET - return a body
hostname:

  • _ - ignores the hostname, path becomes the query
    path:
    • /path/to/dir/or/file - it can be any path including /, this path is the query that will be used with ipfs
      headers:
      • X-Timer - String - a number for a timeout
  • CID - a CID identifier for some data path:
    • / - used for a directory if the CID is a directory
      headers:
      • X-Timer - String - a number for a timeout
    • /path/to/file - used for a file, if the CID is a file headers:
      • X-Timer - String - a number for a timeout

method: POST - return a body
hostname:

  • _ - ignores the hostname, path becomes the query
    path:
    • /path/to/dir/or/file - it can be any path including /, this path is the query that will be used with ipfs
      headers:
      • X-Opt - String - options to use for the content, stringified object

method: DELETE - returns a body
hostname:

  • _ - ignores the hostname, path becomes the query
    path:
    • /path/to/dir/or/file - it can be any path including /, this path is the query that will be used with ipfs
      headers:
      • X-Opt - String - options to use for the content, stringified object

Keywords

FAQs

Package last updated on 30 Mar 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc