Simple key/value (cache) store.
It doesn't do anything fancy and it doesn't have a fancy name. Yet I needed a simple key/value store with optional support for expiration of items.
- Optional expiration of items (without expiration it works as a simple k/v store)
- Per-item configurable TTL.
- Iterable storage
- Written in typescript
- Support writing to JSON or in-memory.
- NodeJS >= 10
- NPM / Yarn
Using yarn (preferred):
yarn add @cloudstek/cache
Using NPM:
npm install @cloudstek/cache
Clone this repository to get started. You can replace yarn
in the commands below with npm
if you use NPM.
During development you can build the code once and have typescript watch for changes and recompile automatically.
yarn run watch
To check the code for style correctness run:
yarn run lint
Tests are run using Ava and coverage is generated using Istanbul. To run the tests run:
yarn run build
yarn run test
To build the code for release (e.g. npm publish), run:
yarn run build:dist
sindresorhus/conf: Simple config handling for your app or module