flipcache
v0.0.12
Published
[temporary], safe, restorable, cacheable, configurable, chainable/fluent data
Downloads
33
Maintainers
Readme
💾💸 flipcache
[temporary], safe, restorable, cacheable, configurable, chainable/fluent data
📦 usage
yarn add flipcache
npm i flipcache --save
const flipcache = require('flipcache')
📘 examples
const onthefly = flipcache
.from('fromfile').end()
.to('otherfile')
.autoRemove(2000)
const mocha = flipcache
.from('mochaOptsFile').end()
.to('mochaOptsBackupFile')
.autoRestore(2000)
const datas = flipcache
.from('./index.js')
.load()
.json()
.update({eh: true})
.parse() // optional, is done for you
.clean()
.write()
👣 dir
const datas = flipcache
.from('./index.js')
.dir(__dirname)
.json()
.setIfNotEmpty({eh: true})
.write()
👽 exports
const {
File,
Files,
Core,
Cache,
JSONChain,
ConfigStore,
FlipFind,
fliphash,
} = require('flipcache')
🔗 more
- for json, json-chain is used
- for resolving paths (unless .dir is used), flipfind is used
- for all fs operations, flipfile is used