Add a string to your Helia node and get a CID that refers to the block the string has been stored as.
Optional
options: Partial<AddOptions>import { strings } from '@helia/strings'
const str = strings(helia)
const cid = await str.add('hello world')
console.info(cid)
// CID(bafkreifzjut3te2nhyekklss27nh3k72ysco7y32koao5eei66wof36n5e)
Get a string from your Helia node, either previously added to it or to another node on the network.
Optional
options: Partial<GetOptions>import { strings } from '@helia/strings'
import { CID } from 'multiformats/cid'
const str = strings(helia)
const cid = CID.parse('bafkreifzjut3te2nhyekklss27nh3k72ysco7y32koao5eei66wof36n5e')
const string = await str.get(cid)
console.info(string)
// hello world
Generated using TypeDoc
The Strings interface provides a simple and intuitive way to add/get strings with your Helia node and is a great place to start learning about IPFS.