fs-memo
easy persisted memo object
Last updated 2 months ago by pi0 .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install fs-memo 
SYNC missed versions from official npm registry.

fs-memo

Easy persisted memo object for Node.js

npm npm (scoped with tag)

Usage

Install package:

yarn add fs-memo
# or
or npm install fs-memo
const { getMemo, setMemo } = require('fs-memo')
// or
import { getMemo, setMemo } from 'fs-memo'

getMemo(options)

getMemo(options: MemoOptions): Promise<any>

Load latest memo from file-system and combine with local state from CJS cache.

FS loading silently bails if:

  • The process that made memo is still alive with different pid
  • Any fs error happens (like permission denied)

setMemo(options)

setMemo(memo: object, options: MemoOptions): Promise<void>

Update local state from CJS cache and persist memo object to file-system.

FS persistence silently bails if any error happens.

Options

dir

Specify directory where memo file should be stored. Default dir is node_modules/.cache/fs-memo

name

Name of memo file. Default name is default (.json is appended to file name)

file

Optionally provide full path to file (discards dir and name options)

License

MIT

Current Tags

  • 1.2.0                                ...           latest (2 months ago)

10 Versions

  • 1.2.0                                ...           2 months ago
  • 1.1.0                                ...           2 months ago
  • 1.0.1                                ...           7 months ago
  • 1.0.0                                ...           7 months ago
  • 0.0.6                                ...           8 months ago
  • 0.0.5                                ...           8 months ago
  • 0.0.4                                ...           8 months ago
  • 0.0.3                                ...           8 months ago
  • 0.0.2                                ...           8 months ago
  • 0.0.1                                ...           8 months ago
Maintainers (1)
Downloads
Today 22
This Week 4,698
This Month 15,834
Last Day 942
Last Week 5,220
Last Month 25,598
Dependencies (0)
None
Dev Dependencies (6)
Dependents (2)

Copyright 2014 - 2016 © taobao.org |