import { importDirectory } from 'ipfs-unixfs-importer'
import { MemoryBlockstore } from 'blockstore-core'
// store blocks in memory, other blockstores are available
const blockstore = new MemoryBlockstore()
const input: DirectoryCandidate = {
path: './foo.txt'
}
const entry = await importDirectory(input, blockstore)
importDir
is similar toimporter
except it accepts a singleDirectoryCandidate
and returns a promise of a singleImportResult
instead of a stream of results.