import { importFile } from 'ipfs-unixfs-importer'
import { MemoryBlockstore } from 'blockstore-core'
// store blocks in memory, other blockstores are available
const blockstore = new MemoryBlockstore()
const input: FileCandidate = {
path: './foo.txt',
content: Uint8Array.from([0, 1, 2, 3, 4])
}
const entry = await importFile(input, blockstore)
importFileis similar toimporterexcept it accepts a singleFileCandidateand returns a promise of a singleImportResultinstead of a stream of results.