File System Storage shared same interface with Browser Storage.
yarn add node-fs-storage # yarn
npm install node-fs-storage # npm
// 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),
})
Detailed changes for each release are documented in CHANGELOG.md.