|
|
3 years ago | |
|---|---|---|
| .. | ||
| dist | 3 years ago | |
| CHANGELOG.md | 3 years ago | |
| LICENSE | 3 years ago | |
| README.md | 3 years ago | |
| package.json | 3 years ago | |
Easy persisted memo object for Node.js
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:
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.
dirSpecify directory where memo file should be stored. Default dir is node_modules/.cache/fs-memo
nameName of memo file. Default name is default (.json is appended to file name)
fileOptionally provide full path to file (discards dir and name options)
MIT