# pistache

> in-memory cache with persistance as JSON / FileSystem storage

Latest version **1.0.1** (published 2017-05-31) · MIT license · 0 weekly downloads

## Install

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

## 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 | 2017-05-31 |
| First published | 2017-05-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Clement Denis |
| Maintainers | kigiri |
| Keywords | cache, pistache, json, storage, fs, async, db, store |

## Links

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

## Dependencies (2)

- [izi](https://npm.io/package/izi.md) ^3.1.0
- [promise-proxy](https://npm.io/package/promise-proxy.md) ^1.0.1

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.0.1 (latest) — 2017-05-31
- 1.0.0 — 2017-05-31

## README

```js
const pistache = require('pistache')

// you pass it the directory name, and a list of index keys
// index keys must be unique, the first will be used as the primary key
const users = pistache('user', [ 'id', 'mail' ])

users.set({
  id: 5,
  firstname: 'jeano',
  lastname: 'pernault',
  mail: 'jpernault@gmail.com',
})

const userJeano = users.get(5)
const userJeanoFromMail = users.get.mail('jpernault@gmail.com')

// write job is delayed in a save loop to allow user to freely spam
// the synchronous api without worrying about it affecting the performances

// All writes are atomics, the primary key is used as file name.
```

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