| Server IP : 185.208.173.17 / Your IP : 87.236.161.98 Web Server : Microsoft-IIS/10.0 System : Windows NT SRV8576125506 10.0 build 26100 (Windows Server 2016) AMD64 User : IUSR ( 0) PHP Version : 7.4.13 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/inetpub/wwwroot/parsmega.nuxt/node_modules/fs-memo/ |
Upload File : |
# fs-memo
> Easy persisted memo object for Node.js
[](https://npmjs.com/package/fs-memo)
[](https://npmjs.com/package/fs-memo)
## Usage
Install package:
```bash
yarn add fs-memo
# or
or npm install fs-memo
```
```js
const { getMemo, setMemo } = require('fs-memo')
// or
import { getMemo, setMemo } from 'fs-memo'
```
### `getMemo(options)`
```ts
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)`
```ts
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