1.0.1 • Published 4 months ago

@cypsela/browser-source v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

browser-source

W3C's FileSystemEntry and FileSystemHandle as a sources for @helia/unixfs

Install

npm i @cypsela/browser-source

Usage

Api docs: cypsela.github.io/browser-source

FileSystemEntry Source

import { fsEntrySource, BrowserFsItemSourceOptions } from '@cypsela/browser-source'
import { createHelia } from 'helia'
import { unixfs } from '@helia/unixfs'

const helia = await createHelia()
const fs = unixfs(helia)

const options: BrowserFsItemSourceOptions = { ... }

for await (const _ of fs.addAll(fsEntrySource(<FileSystemEntry>, options))) {}

FileSystemHandle Source

import { fsHandleSource, BrowserFsItemSourceOptions } from '@cypsela/browser-source'
import { createHelia } from 'helia'
import { unixfs } from '@helia/unixfs'

const helia = await createHelia()
const fs = unixfs(helia)

const options: BrowserFsItemSourceOptions = { ... }

for await (const _ of fs.addAll(fsHandleSource(<FileSystemHandle>, options))) {}
1.0.1

4 months ago

1.0.0

4 months ago

0.0.0

4 months ago