node-fs-storage
v0.1.1
Published
[](https://github.com/rx-ts/node-fs-storage/actions/workflows/ci.yml) [](https://codecov.io/gh/r
Readme
node-fs-storage
File System Storage shared same interface with Browser Storage.
TOC
Usage
Install
yarn add node-fs-storage # yarn
npm install node-fs-storage # npmAPI
// default
import { fsStorage } from 'node-fs-storage'
fsStorage.setItem('key', 'value')
fsStorage.getItem('key')
fsStorage.key(0)
fsStorage.length
fsStorage.removeItem('key')
fsStorage.clear()// custom
import { FsStorage } from 'node-fs-storage'
// custom path
const fsStorage1 = new FsStorage(path.resolve('.storage'))
// custom `path` and key `encoder`, make sure it is a valid filename
const fsStorage2 = new FsStorage({
path: path.resolve('.storage'),
encoder: hash(key),
})Changelog
Detailed changes for each release are documented in CHANGELOG.md.
