nano-ipfs-store
Store strings/buffers on IPFS. 3.1K gzipped.
This is a fork of ipfs-mini, with some slight changes based on what I needed for a project.
Methods
ipfsadd : Uint8Array | String -> Promise CID // Uploads Uint8Array or String to IPFSipfsget : CID -> Promise Uint8Array // Gets Uint8Array from IPFSipfscat : CID -> Promise String // Gets String from IPFSipfscid : Uint8Array | String -> Promise CID // Gets the CID without performing the upload
Example
const IPFS = ;const ipfs = IPFS;const assert = ; async { // Upload raw data const data1 = 0137153163127255; const cid1 = await ipfs; // Recover it from returned CID const data2 = await ipfs; ; // Generate CID without uploading const cid2 = await ipfs; ; // Upload string ; console; };
A note
I'd just like to thank the guys behind IPFS and IPFS-mini, the hackers on IRC, but, in special, Kubuxu on #ipfs at freenode.net, who, at 5am, took some time to show me live how to find the CID of a blob. Thank you.