node-weixin-settings

node weixin settings

Usage no npm install needed!

<script type="module">
  import nodeWeixinSettings from 'https://cdn.skypack.dev/node-weixin-settings';
</script>

README

node-weixin-settings NPM version Build Status Dependency Status Coverage percentage

node weixin settings

Installation

$ npm install --save node-weixin-settings

Usage

用于保存/获取只跟微信app id对应的数据

  1. 使用前一定要registerSet,registerGet,使用自定义的get,set函数
  2. 如果不使用,会导致内存不断上涨,并且无法回收
  3. 注册的采用回调方式,以便更加灵活应对不同的场景
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
});

License

Apache-2.0 © calidion