fliphub-monorepo
Version:
the builder of builders
76 lines (61 loc) β’ 1.77 kB
Markdown
//img.shields.io/npm/v/flipcache.svg
[ ]: https://npmjs.org/package/flipcache
[ ]: http://img.shields.io/badge/license-MIT-blue.svg?style=flat
[ ]: https://spdx.org/licenses/MIT
[ ]: https://img.shields.io/gitter/room/fliphub/pink.svg
[ ]: https://gitter.im/fliphub/Lobby
[ ]: https://img.shields.io/badge/%F0%9F%8F%97%20%F0%9F%92%A0-flipfam-9659F7.svg
[ ]: https://www.npmjs.com/package/flipfam
> [temporary], safe, restorable, cacheable, configurable, chainable/fluent data
```bash
yarn add flipcache
npm i flipcache --save
```
```js
const flipcache = require('flipcache')
```
```js
const onthefly = flipcache
.from('fromfile').end()
.to('otherfile')
.autoRemove(2000)
```
```js
const mocha = flipcache
.from('mochaOptsFile')
.to('mochaOptsBackupFile')
.autoRestore(2000)
```
```js
const datas = flipcache
.from('./index.js')
.load()
.json()
.update({eh: true})
.parse() // optional, is done for you
.clean()
.write()
```
```js
const datas = flipcache
.from('./index.js')
.dir(__dirname)
.json()
.setIfNotEmpty({eh: true})
.write()
```
- for json, [json-chain][json-chain] is used
- for resolving paths (unless .dir is used), [flipfind][flipfind] is used
- for all fs operations, [flipfile][flipfile] is used
[json-chain]: https://www.npmjs.com/package/json-chain
[flipfind]: https://www.npmjs.com/package/flipfind
[flipfile]: https://www.npmjs.com/package/flipfile
[![NPM version][flipcache-image]][flipcache-url]
[![MIT License][license-image]][license-url]
[![fliphub][gitter-badge]][gitter-url]
[![flipfam][flipfam-image]][flipfam-url]
[ ]: https: