@helia/mfs

@helia/mfs is an implementation of a Mutable File System powered by Helia.

See the interface for all available operations.

Example

import { createHelia } from 'helia'
import { mfs } from '@helia/mfs'

const helia = createHelia({
// ... helia config
})
const fs = mfs(helia)

// create an empty directory
await fs.mkdir('/my-directory')

// add a file to the directory
await fs.writeBytes(Uint8Array.from([0, 1, 2, 3]), '/my-directory/foo.txt')

// read the file
for await (const buf of fs.cat('/my-directory/foo.txt')) {
console.info(buf)
}

Index

Interfaces

Type Aliases

Functions

Generated using TypeDoc