
Security News
PEP 810 Proposes Explicit Lazy Imports for Python 3.15
An opt-in lazy import keyword aims to speed up Python startups, especially CLIs, without the ecosystem-wide risks that sank PEP 690.
@zhike/co-wechat-api
Advanced tools
微信公共平台API。
此项目 Fork 自原作者项目,原因是微信公众平台添加了一些新的接口,找其他包要考虑历史兼容性问题,于是决定在此包上扩展,由于仅针对内部使用,所以可能不够完善,将来也不会合回主项目
详细参见API文档
$ npm install co-wechat-api
var WechatAPI = require('co-wechat-api');
async function() {
var api = new WechatAPI(appid, appsecret);
var result = await api.updateRemark('open_id', 'remarked');
}
当多进程时,token需要全局维护,以下为保存token的接口:
var api = new API('appid', 'secret', async function () {
// 传入一个获取全局token的方法
var txt = await fs.readFile('access_token.txt', 'utf8');
return JSON.parse(txt);
}, async function (token) {
// 请将token存储到全局,跨进程、跨机器级别的全局,比如写到数据库、redis等
// 这样才能在cluster模式及多机情况下使用,以下为写入到文件的示例
await fs.writeFile('access_token.txt', JSON.stringify(token));
});
原始API文档请参见:消息接口指南。
The MIT license.
FAQs
微信公共平台Node库API,ES6版本
We found that @zhike/co-wechat-api demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 9 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
An opt-in lazy import keyword aims to speed up Python startups, especially CLIs, without the ecosystem-wide risks that sank PEP 690.
Security News
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.