# seq-file

> A module for storing the ever-increasing sequence files when following couchdb _changes feeds.

Latest version **1.3.1** (published 2016-01-07) · ISC license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install seq-file
pnpm add seq-file
yarn add seq-file
bun add seq-file
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.3.1 |
| Published | 2016-01-07 |
| First published | 2014-02-01 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 18 |
| Author | Isaac Z. Schlueter |
| Maintainers | bcoe, isaacs, soldair |
| Keywords | changes, sequence, file |

## Links

- npm: https://www.npmjs.com/package/seq-file
- Repository: https://github.com/isaacs/seq-file
- Issues: https://github.com/isaacs/seq-file/issues
- npm.io page: https://npm.io/package/seq-file

## Dependencies (1)

- [touch](https://npm.io/package/touch.md) 0.0.3

## 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.1 (latest) — 2016-01-07
- 1.3.0 — 2016-01-06
- 1.2.1 — 2015-01-12
- 1.2.0 — 2015-01-12
- 1.1.0 — 2014-11-03
- 1.0.2 — 2014-06-06
- 1.0.1 — 2014-02-01
- 1.0.0 — 2014-02-01

## README

# seq-file

A module for storing the ever-increasing sequence files when following
couchdb _changes feeds.

Saves the sequence ID in an atomic way, so that it doesn't clobber the
file if it crashes mid-save.  Only does a single save at a time, so
you can bang on it repeatedy, and it'll avoid doing unnecessary file
IO or weird cases where two writes cross paths in odd ways.

## USAGE

```javascript
var SF = require('seq-file')
var s = new SF('sequence.seq')

s.save(10)
console.log(s.seq) // 10
s.save(11) // won't actually save, because still saving the 10
console.log(s.seq) // 11.  You get the idea.

// some time in the future, another change comes in
s.save(21)

// oh no!  crash while saving!
s.save(34)
throw 'pwn' // file now contains "21", not ""
```

## OPTIONS

* **frequency:** modify how frequently a sequence number is saved.

```javascript
var SF = require('seq-file', {
  frequency: 4
})
var s = new SF('sequence.seq')
s.save(11) // this won't save (we only save every 4 increments).
s.save(12) // this will totally save.
```

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