# circular-append-file

> A simple appendable-file interface which enforces a size cap by overwriting itself.

Latest version **1.0.1** (published 2018-03-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install circular-append-file
pnpm add circular-append-file
yarn add circular-append-file
bun add circular-append-file
```

## 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.1 |
| Published | 2018-03-12 |
| First published | 2018-03-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 9 |
| Author | Paul Frazee |
| Maintainers | pfraze |
| Keywords | file, append |

## Links

- npm: https://www.npmjs.com/package/circular-append-file
- Repository: https://github.com/pfrazee/circular-append-file
- Homepage: https://github.com/pfrazee/circular-append-file#readme
- Issues: https://github.com/pfrazee/circular-append-file/issues
- npm.io page: https://npm.io/package/circular-append-file

## Dependencies (1)

- [multistream](https://npm.io/package/multistream.md) ^2.1.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.0.1 (latest) — 2018-03-12
- 1.0.0 — 2018-03-12

## README

# circular-append-file

A simple appendable-file interface which enforces a size cap by overwriting itself.
A good way to maintain a log where you want to drop history after you hit a size limit.

Currently clears the file on open, then will write each append to the end until the `maxSize` is hit.
Will then circle back to the top and continue writing.

Currently only supports strings.

```js
const CircularAppendFile = require('circular-append-file')

let log = CircularAppendFile('./app.log', {
  maxSize: 1024 // 1kb (default is 32mb)
})
log.append('Hello\n')
log.append('World!\n')
log.createReadStream().pipe(process.stdout)
log.close()
```

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