# @hbauer/local-file

> ## Install

Latest version **0.5.0** (published 2023-05-29) · 0 weekly downloads

## Install

```sh
npm install @hbauer/local-file
pnpm add @hbauer/local-file
yarn add @hbauer/local-file
bun add @hbauer/local-file
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.5.0 |
| Published | 2023-05-29 |
| First published | 2023-05-20 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 99.5 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Donald Geddes |
| Maintainers | hbauer |

## Links

- npm: https://www.npmjs.com/package/@hbauer/local-file
- Repository: https://github.com/handlebauer/local-file
- npm.io page: https://npm.io/package/@hbauer/local-file

## Dependencies (3)

- [zod](https://npm.io/package/zod.md) ^3.21.4
- [remeda](https://npm.io/package/remeda.md) ^1.14.0
- [@hbauer/convenience-functions](https://npm.io/package/@hbauer/convenience-functions.md) ^0.34.1

## Recent versions

- 0.5.0 (latest) — 2023-05-29
- 0.4.12 — 2023-05-26
- 0.4.11 — 2023-05-26
- 0.4.10 — 2023-05-25
- 0.4.9 — 2023-05-25
- 0.4.8 — 2023-05-23
- 0.4.7 — 2023-05-23
- 0.4.6 — 2023-05-22
- 0.4.5 — 2023-05-22
- 0.4.4 — 2023-05-22
- 0.4.3 — 2023-05-22
- 0.4.2 — 2023-05-22
- 0.4.1 — 2023-05-22
- 0.4.0 — 2023-05-22
- 0.3.2 — 2023-05-21
- … 18 more at https://npm.io/package/@hbauer/local-file/versions

## README

# @hbauer/local-file

## Install

```sh
$ yarn add @hbauer/local-file
$ npm install @hbauer/local-file
```

## Usage

```js
import { LocalFile } from '@hbauer/local-file'

const path = 'src/path/to/data'
const data = { foo: 'bar' }

const savedFile = await LocalFile.save(path, data)

assert(savedFile.data === data)
assert(typeof savedFile.createdAt.date === 'date')
assert(typeof savedFile.createdAt.milliseconds === 'number')

const file = await LocalFile.read(path, data) // throws error if the file doesn't exist

assert.deepEqual(savedFile.data, file.data)

// TODO: finish readme
```

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