# fastfile

> fast cached read write of big binary files

Latest version **0.0.20** (published 2022-06-07) · GPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install fastfile
pnpm add fastfile
yarn add fastfile
bun add fastfile
```

## Health

**Score 35/100 (D)** — status: abandoned.

Positive: esm support; no vulnerabilities; high maintenance score.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.0.20 |
| Published | 2022-06-07 |
| First published | 2020-04-19 |
| Weekly downloads | 0 |
| License | GPL-3.0 |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 107.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 9 |
| Author | 0kims |
| Maintainers | jbaylina |
| Keywords | file, io, large, binary, cache, random |

## Links

- npm: https://www.npmjs.com/package/fastfile
- Repository: https://github.com/iden3/fastfile
- Homepage: https://github.com/iden3/fastfile#readme
- Issues: https://github.com/iden3/fastfile/issues
- npm.io page: https://npm.io/package/fastfile

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 0.0.20 (latest) — 2022-06-07
- 0.0.19 — 2020-10-22
- 0.0.18 — 2020-09-24
- 0.0.17 — 2020-09-24
- 0.0.16 — 2020-09-16
- 0.0.15 — 2020-09-07
- 0.0.14 — 2020-08-29
- 0.0.13 — 2020-08-19
- 0.0.12 — 2020-07-29
- 0.0.11 — 2020-07-26
- 0.0.10 — 2020-07-26
- 0.0.9 — 2020-07-25
- 0.0.8 — 2020-07-23
- 0.0.7 — 2020-07-18
- 0.0.6 — 2020-07-11
- … 5 more at https://npm.io/package/fastfile/versions

## README

# fastfile

fastfile is a package to read/write binary files with a transparent cache.

This library maintains a read and write cache that allows to write asynchronously
improving the speed of the reads and writes of big files.

## Usage

```
npm install fastfile
```

```javascript

const fastFile = require("fastfile");

async function writeFile() {
    const f = await fastFile.createOverride("pattern.bin");

    const buff = Buffer.from("0001020304050607", "hex");
    for (let i=0; i<1000; i++) {
        await f.write(buff, i*8);
    }

    await f.close();
}

async function readFile() {
    const f = await fastFile.readExisting("pattern.bin");

    const buff = await f.read(16, 8);

    await f.close();

    return buff;

}

writeFile().then( () => {
    readFile().then( (buff) => {
        console.log(buff.toString("hex"));
    });
});

```

## License

fastfile is part of the iden3 project copyright 2018 0KIMS association and published with GPL-3 license. Please check the COPYING file for more details.

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