fs-memo

easy persisted memo object

MIT 10 个版本
安装
npm install fs-memo
yarn add fs-memo
pnpm add fs-memo
bun add fs-memo
README

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

版本列表
1.2.0 2020-11-16
1.1.0 2020-11-16
1.0.1 2020-06-16
1.0.0 2020-06-16
0.0.6 2020-06-01
0.0.5 2020-05-31
0.0.4 2020-05-31
0.0.3 2020-05-31
0.0.2 2020-05-31
0.0.1 2020-05-31