0.0.7 • Published 2 years ago

ipfs-browser-global v0.0.7

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

To use, simply:

npm i github:DougAnderson444/ipfs-browser-global

then just import it, and use it:

// IPFS saver
import IPFS from 'ipfs-browser-global'
IPFS() // initialize it

// now you'll have access to the global (window.)ipfs object
  async save (saveObject) {
    if (!ipfs) await IPFS()
    const rootCID = ipfs.dag.put(saveObject, { pin: true })
    return rootCID
  }