@helia/mfs is an implementation of a Mutable File System powered by Helia.
@helia/mfs
See the interface for all available operations.
import { createHelia } from 'helia'import { mfs } from '@helia/mfs'const helia = createHelia({ // ... helia config})const fs = mfs(helia)// create an empty directoryawait fs.mkdir('/my-directory')// add a file to the directoryawait fs.writeBytes(Uint8Array.from([0, 1, 2, 3]), '/my-directory/foo.txt')// read the filefor await (const buf of fs.cat('/my-directory/foo.txt')) { console.info(buf)} Copy
import { createHelia } from 'helia'import { mfs } from '@helia/mfs'const helia = createHelia({ // ... helia config})const fs = mfs(helia)// create an empty directoryawait fs.mkdir('/my-directory')// add a file to the directoryawait fs.writeBytes(Uint8Array.from([0, 1, 2, 3]), '/my-directory/foo.txt')// read the filefor await (const buf of fs.cat('/my-directory/foo.txt')) { console.info(buf)}
Generated using TypeDoc
@helia/mfs
is an implementation of a Mutable File System powered by Helia.See the interface for all available operations.
Example