node weixin settings
$ npm install --save node-weixin-settings
用于保存/获取只跟微信app id对应的数据
- 使用前一定要registerSet,registerGet,使用自定义的get,set函数
- 如果不使用,会导致内存不断上涨,并且无法回收
- 注册的采用回调方式,以便更加灵活应对不同的场景
var nodeWeixinSettings = require('node-weixin-settings');
nodeWeixinSettings.registerSet(function () {
});
nodeWeixinSettings.registerGet(function () {
});
nodeWeixinSettings.get(id, key, function (data) {
//data is the value you needed
});
nodeWeixinSettings.set(id, key, value, function () {
//end of set
});
nodeWeixinSettings.all(id, function (data) {
//data is the value you needed
});
Apache-2.0 © calidion