Add all files and directories from the passed stream. This method wraps the
importer
export from the ipfs-unixfs-importer
module - please see the docs
for input/output types.
Optional
options: Partial<AddOptions>Add a single Uint8Array
to your Helia node and receive a CID that will
resolve to it.
If you want to preserve a file name or other metadata such as modification
time or mode, use addFile
instead.
Optional
options: Partial<AddFileOptions>Add a stream of Uint8Array
s to your Helia node and receive a CID that
will resolve to them.
If you want to preserve a file name or other metadata such as modification
time or mode, use addFile
instead.
Optional
options: Partial<AddFileOptions>Add a directory to your Helia node.
Optional
dir: Partial<DirectoryCandidate>Optional
options: Partial<AddFileOptions>If no path is specified, the returned CID will resolve to an empty directory.
const cid = await fs.addDirectory()
console.info(cid) // empty directory CID
If a path is specified, the CID will resolve to a directory that contains an empty directory with the specified name.
const cid = await fs.addDirectory({
path: 'my-dir'
})
console.info(cid) // containing directory CID
const stat = await fs.stat(cid, {
path: 'my-dir'
})
console.info(stat.cid) // empty directory CID
Add a file to your Helia node with metadata. The returned CID will resolve to a directory with one file entry.
If you don't care about file names and just want a CID that will resolve to
the contents of the file, use addBytes
or addByeStream
instead.
Optional
options: Partial<AddFileOptions>Retrieve the contents of a file from your Helia node.
Optional
options: Partial<CatOptions>List directory contents.
Return statistics about a UnixFS DAG.
Optional
options: StatOptionsOptional
options: ExtendedStatOptions
The UnixFS interface provides familiar filesystem operations to make working with UnixFS DAGs simple and intuitive.