Socket
Socket
Sign inDemoInstall

fs-memo

Package Overview
Dependencies
0
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    fs-memo

easy persisted memo object


Version published
Weekly downloads
212K
decreased by-14.32%
Maintainers
1
Install size
7.59 kB
Created
Weekly downloads
 

Changelog

Source

1.2.0 (2020-11-16)

Features

  • options.file (813a517)

Readme

Source

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

FAQs

Last updated on 16 Nov 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc