@helia/dag-json makes working with DAG-JSON Helia simple & straightforward.
@helia/dag-json
See the DAGJSON interface for all available operations.
import { createHelia } from 'helia'import { dagJson } from '@helia/dag-json'import { CID } from 'multiformats/cid'const helia = await createHelia()const j = dagJson(helia)const cid = await j.add({ hello: 'world'})const obj = await j.get(cid)console.info(obj)// { hello: 'world' } Copy
import { createHelia } from 'helia'import { dagJson } from '@helia/dag-json'import { CID } from 'multiformats/cid'const helia = await createHelia()const j = dagJson(helia)const cid = await j.add({ hello: 'world'})const obj = await j.get(cid)console.info(obj)// { hello: 'world' }
@helia/dag-jsonmakes working with DAG-JSON Helia simple & straightforward.See the DAGJSON interface for all available operations.
Example