# fsa-chunk-store

> File System Access API chunk store that is abstract-chunk-store compliant, with filesystem-like folder structure.

Latest version **1.3.0** (published 2024-08-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install fsa-chunk-store
pnpm add fsa-chunk-store
yarn add fsa-chunk-store
bun add fsa-chunk-store
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.0 |
| Published | 2024-08-04 |
| First published | 2022-03-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 36.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | ThaUnknown_ |
| Maintainers | thaunknown |
| Keywords | abstract-chunk-store, chunk, webfs, file system access api, filesystem access, file system access, FileSystemHandle, FileSystemFileHandle, FileSystemDirectoryHandle, FileSystemWritableFileStream |

## Links

- npm: https://www.npmjs.com/package/fsa-chunk-store
- Repository: https://github.com/ThaUnknown/fsa-chunk-store
- Issues: https://github.com/ThaUnknown/fsa-chunk-store/issues
- npm.io page: https://npm.io/package/fsa-chunk-store

## Dependencies (1)

- [filename-reserved-regex](https://npm.io/package/filename-reserved-regex.md) ^3.0.0

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 1.3.0 (latest) — 2024-08-04
- 1.1.5 — 2024-03-21
- 1.1.4 — 2023-06-15
- 1.1.3 — 2023-01-23
- 1.1.2 — 2022-11-17
- 1.1.1 — 2022-11-16
- 1.1.0 — 2022-10-29
- 1.0.0 — 2022-03-05

## README

# fsa-chunk-store

#### [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

[![abstract chunk store](https://cdn.rawgit.com/mafintosh/abstract-chunk-store/master/badge.svg)](https://github.com/mafintosh/abstract-chunk-store)

## Install

```
npm install https://github.com/ThaUnknown/fsa-chunk-store
```

## Usage

```js
const FSAChunkStore = require('fsa-chunk-store')
const chunks = FSAChunkStore(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()`)
- `files`: Array of File objects (optional, `{ path, length }`)

## About

Originally based on https://github.com/SocketDev/fs-access-chunk-store but improved to support filesystem-like folder structures, to allow external user manipulation of files.

## License

MIT.

---
_Source: https://npm.io/package/fsa-chunk-store · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
