[Node.js] node-persist: localStorage on the server

// Save data

var storage = require('node-persist');
storage.init();

var people= require('./people.json');

people.forEach( (person)=>{
  storage.setItem(person.id.toString(), person);
});


// get data
let person_11 = storage.getItem(11);

 

posted @ 2015-12-26 18:10  Zhentiw  阅读(398)  评论(0编辑  收藏  举报