Socket
Book a DemoInstallSign in
Socket

@neuroo_fe/wechat-user-iterator

Package Overview
Dependencies
Maintainers
4
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@neuroo_fe/wechat-user-iterator

微信用户信息迭代器

0.0.3
latest
Source
npmnpm
Version published
Weekly downloads
3
Maintainers
4
Weekly downloads
 
Created
Source

wechat-user-iterator

微信信息列表迭代器。

Usage

npm i @neuroo_fe/wechat-user-iterator -S
const UserIterator = require('@neuroo_fe/wechat-user-iterator')
const iterator = new UserIterator({
  appId: '',
  appSecret: ''
})

iterator
  .on('user', console.log)
  .on('error', console.error)
  .on('finish', console.log)
  .start()

UserIterator

new UserIterator(options) 返回UserIterator实例对象。

options 参数属性

名称类型必填描述
appIdString特殊可选微信公众号appId
appSecretString特殊可选微信公众号appSecret
getTokenFunction特殊可选获取access_token函数。
当使用此参数时,可省略appIdappSecret
详情见wechat-api 多进程
concurrentNumber并发数。默认为1

UserIterator实例方法

start

开始迭代用户信息列表,会多次触发user事件。完成时会触发finish事件。

stop

暂停迭代。

resume

恢复迭代。

UserIterator实例事件

user

获取到单个用户信息时触发user事件

result 参数属性

名称类型描述
currentNumber当前用户的下标。
totalNumber所有用户的数量。
userObject用户信息对象。

users

获取到多个用户信息时触发users事件

result 参数属性

名称类型描述
currentNumber当前用户的下标。
totalNumber所有用户的数量。
usersArray多个用户信息对象数组。

finish

完成迭代时触发。

result 参数属性

名称类型描述
totalNumber所有用户的数量。
startTimeString开始时间。
endTimeString结束时间。

error

获取信息出错时触发error事件。参数为Error实例对象。

Keywords

wechat

FAQs

Package last updated on 19 Sep 2017

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.