@cypsela/browser-source
    Preparing search index...

    @cypsela/browser-source

    browser-source

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

    npm i @cypsela/browser-source

    live: https://browser-source.cypsela.eth.limo

    source: ./example

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

    Instances of these data types are available from <input type="file" /> elements, drag-and-drop events, and window methods like showOpenFilePicker.

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

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

    const list: FileList = /* Get from <input type="file" /> elements */;

    for await (const { cid } of fs.addAll(fileListSource(list))) {}
    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 entry: FileSystemEntry = /* Get from drag-and-drop events */;

    for await (const _ of fs.addAll(fsEntrySource(entry))) {}
    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 handle: FileSystemHandle = /* Get from drag-and-drop events and window methods */

    for await (const _ of fs.addAll(fsHandleSource(handle))) {}