node-storages

0.0.3 • Public • Published

node-storages

在node 环境下简易的数据存储

npm

为什么不使用现有的 node-storage ?

因为我希望storage有一个可选的超时机制

npm install node-storages --save
const storages = require('node-storages')
const path = require('path')

const storage = new Storage({filePath:path.join(__dirname, './data.json'),sync:true})
// 马上调用setItem需要sync设为true
// 否则需要等待storage对象读取文件结束后才能够使用 可根据实际情况设置
storage.setItem('time',new Date())
console.log(storage.getItem('time'))

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.3
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.3
    0
  • 0.0.2
    1
  • 0.0.1
    1
  • 0.0.0
    1

Package Sidebar

Install

npm i node-storages

Weekly Downloads

3

Version

0.0.3

License

ISC

Unpacked Size

5.22 kB

Total Files

3

Last publish

Collaborators

  • kooritea