https://github.com/webtorrent/fs-access-chunk-store
File System Access API chunk store that is abstract-chunk-store compliant
https://github.com/webtorrent/fs-access-chunk-store
Last synced: 3 months ago
JSON representation
File System Access API chunk store that is abstract-chunk-store compliant
- Host: GitHub
- URL: https://github.com/webtorrent/fs-access-chunk-store
- Owner: webtorrent
- License: mit
- Created: 2021-06-02T16:38:44.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2025-08-12T02:39:05.000Z (5 months ago)
- Last Synced: 2025-08-12T07:54:06.318Z (5 months ago)
- Language: JavaScript
- Size: 11.7 KB
- Stars: 12
- Watchers: 3
- Forks: 7
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# fs-access-chunk-store [![ci][ci-image]][ci-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url]
[ci-image]: https://img.shields.io/github/workflow/status/webtorrent/fs-access-chunk-store/ci/master
[ci-url]: https://github.com/webtorrent/fs-access-chunk-store/actions
[npm-image]: https://img.shields.io/npm/v/fs-access-chunk-store.svg
[npm-url]: https://npmjs.org/package/fs-access-chunk-store
[downloads-image]: https://img.shields.io/npm/dm/fs-access-chunk-store.svg
[downloads-url]: https://npmjs.org/package/fs-access-chunk-store
[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg
[standard-url]: https://standardjs.com
#### [File System Access API](https://web.dev/file-system-access/) chunk store that is [abstract-chunk-store](https://github.com/mafintosh/abstract-chunk-store) compliant
[](https://github.com/mafintosh/abstract-chunk-store)
## Install
```
npm install fs-access-chunk-store
```
## Usage
```js
const fsAccessChunkStore = require('fs-access-chunk-store')
const chunks = fsAccessChunkStore(10)
chunks.put(0, new Buffer('01234567890'), function (err) {
if (err) throw err
chunks.get(0, function (err, chunk) {
if (err) throw err
console.log(chunk) // '01234567890' as a buffer
})
})
```
## Options
- `length`: Total size of the chunk store (optional, default: `Infinity`)
- `name`: Top-level directory to create for this store (optional, default: `default`)
- `rootDir`: Root directory handle (optional, default: `navigator.storage.getDirectory()`)
## License
MIT. Copyright (c) [WebTorrent, LLC](https://webtorrent.io)