# sgcachedfile

> sg libs to write file with content changing check

Latest version **1.0.0** (published 2022-09-27) · ISC license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2022-09-27 |
| First published | 2022-09-27 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 5.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Slipper.SG |
| Maintainers | slipper.sg |

## Links

- npm: https://www.npmjs.com/package/sgcachedfile
- npm.io page: https://npm.io/package/sgcachedfile

## Dependencies (2)

- [sgcrc16](https://npm.io/package/sgcrc16.md) ^1.0.0
- [sgstatcache](https://npm.io/package/sgstatcache.md) ^1.0.1

## Recent versions

- 1.0.0 (latest) — 2022-09-27

## README

# Usage

check src or output changed by mtime and fileSize cache.

```javascript
const { SgCachedLib } = require("sgcachedfile");

(async () => {
    // create a lib with stat cache file
    const testLib = new SgCachedLib("testDBs")

    // create a out file from lib
    let out = testLib.createOut();

    // write datas
    let arr = new Uint8Array(64 * 1023).fill(48);
    console.log("write arr", out.write(arr));
    console.log("write string", out.write("String"));

    // close files
    console.log("close file", await out.close("test.txt"))

    // close lib
    console.log("close lib", testLib.close());
})();

```

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