New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More

ipfs-client

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ipfs-client

A client library to talk to local IPFS daemons


Version published
Weekly downloads
377
decreased by-16.78%
Maintainers
2
Weekly downloads
 
Created

ipfs-client

A client for ipfs daemons

This module combines the ipfs-grpc-client and ipfs-http-client modules to give you a client that is capable of bidirectional streaming in the browser as well as node.

Install

$ npm install ipfs-client

API

The client object created by the createClient function supports the IPFS Core API, see the docs for more.

create([options])

Parameters

None

Options

An optional object which may have the following keys:

NameTypeDefaultDescription
grpcMultiaddr or string or URLundefinedThe address of a ipfs-grpc-server to connect to
httpMultiaddr or string or URLundefinedThe address of a ipfs-http-server to connect to
agenthttp.AgentundefinedA http.Agent used to control HTTP client behaviour (node.js only)

Returns

TypeDescription
objectAn instance of the client

Example

const { create } = require('ipfs-client')

const client = create({
  grpc: '/ipv4/127.0.0.1/tcp/5003/ws',
  http: '/ipv4/127.0.0.1/tcp/5002/http'
})

const id = await client.id()

Keywords

FAQs

Package last updated on 07 Sep 2021

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