@osn/ipfs

0.1.0 • Public • Published

osn ipfs client

This is an IPFS client that provides a simplified API interface for uploading content to IPFS. You can config the API to connect to Infura or a locally ipfs node by parameters.

Usage example

const { getClients, ClientOptions, ClientMode } = require("@osn/ipfs");
const {
  INFURA_PROJECT_ID,
  INFURA_PROJECT_SECRET,
  LOCAL_IPFS_NODE_URL,
  USE_LOCAL_IPFS_NODE,
} = require("../env");

const [ipfsClient] = getClients(
  USE_LOCAL_IPFS_NODE ? ClientMode.Local : ClientMode.Infura,
  new ClientOptions(
    INFURA_PROJECT_ID,
    INFURA_PROJECT_SECRET,
    LOCAL_IPFS_NODE_URL
  )
);

Dependencies (3)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i @osn/ipfs

    Weekly Downloads

    17

    Version

    0.1.0

    License

    Apache-2.0

    Unpacked Size

    15.3 kB

    Total Files

    14

    Last publish

    Collaborators

    • hyifeng
    • osn_jh
    • yoshiyuki_asakura
    • wliyongfeng