0.0.12 β’ Published 7 years ago
flipcache v0.0.12
πΎπΈ 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