npm.io
0.0.12 • Published 9 years ago

flipcache

Licence
—
Version
0.0.12
Deps
9
Vulns
0
Weekly
0
Stars
30

flipcache

NPM version MIT License fliphub flipfam

[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

Keywords