1.0.2 • Published 5 years ago
tmp-store v1.0.2
tmp-store
Temporary file system cache with events and sub storage.
Install
$ npm install tmp-store
Usage
Node.js / CommonJS:
const { TmpStore } = require('tmp-store')
ESNext / TypeScript:
import { TmpStore } from 'tmp-store'
API
Standard use:
const cache = new TmpStore('my-package')
const files = cache.getStore('files')
files.set('foo.json', '{ "hello": "world" }')
const fooContents = files.get('foo.json') // '{ "hello": "world" }'
// Save sync
cache.saveSync()
// or async
await cache.save()