npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

gbunityapi

v0.1.2

Published

A node.js module that can validate user and get info.

Readme

gbunityapi

##目标 五个验证和获取通讯录信息的node.js方法。分别为验证用户合法性、获取用户信息、获取通讯录信息、获取用户可见的通讯录组织信息、获取用户可见的通讯录用户信息。

##安装 Via npm.

npm install gbunityapi

##api列表

  • validateUser(sessionId, userId, callback)
  • getUserInfo (sessionId, userId, callback)
  • getAddressBook (callback)
  • getOrganizationsOfUser (userId, sessionId, callback)
  • getContactersOfUser (userId, sessionId, orgnizationId, callback)

##API ###validateUser(sessionId, userId, callback) ###getUserInfo (sessionId, userId, callback) ###getAddressBook (callback) ###getOrganizationsOfUser (userId, sessionId, callback) ###getContactersOfUser (userId, sessionId, orgnizationId, callback)

  • sessionId: 会话id
  • userId: 用户id
  • orgnizationId:组织id
  • callback: 回调函数

var api = require('gbunityapi'); api.validateUser(sessionId,userId,fun(){}) 其中fun()函数是一个返回Promise对象的函数,返回结果如下:

{ 
   "result": "success",  
   "failedMessage": "",  
   "validation": "valid" 
 }

api.getUserInfo (sessionId, userId, fun(){})) 其中fun()函数是一个返回Promise对象的函数,返回结果如下:

 { 
   "result": "success",  
   "failedMessage": "",  
   "personal":{  
     "id":"5837e952e0095f1320eae372", 
     "userName":"zhangbin199", 
     "name":"张滨", 
     "email":"[email protected]", 
     "mobilePhone":"13763286281", 
     "phone":"(021)33674998-2130", 
     "shortPhone":"6338", 
     "gender":"男", 
     "sortNumber":10 
   }, 
   "authorities":[{ 
     "code":"5837e952e0wwfd5f1320eae372", 
     "name":"审批员", 
     "remark":"备注", 
     "sortNumber":3 
     },{ 
     "code":"5837ekude0wwfd5f1320eae372", 
     "name":"签到发起人", 
     "remark":"备注", 
     "sortNumber":2 
   }] 
 } 

api.getAddressBook (fun(){})) 其中fun()函数是一个返回Promise对象的函数,返回结果如下:

 { 
   "result": "success",  
   "failedMessage": "",  
   "organizations":[{  
     "id":"5837e952e0095f1320eae372", 
     "name":"金桥信息", 
     "parentId ":"", 
     "sortNumber":1 
   },{ 
     "id":"5837e952e0095f13208dj398", 
     "name":"技术中心", 
     "parentId ":"5837e952e0095f1320eae372", 
     "sortNumber":1 
   }], 
   "users":[{ 
       "id":"5837e952e0095f1320eae338", 
       "userName":"zhangbin199", 
       "name":"张滨", 
       "email":"[email protected]", 
       "mobilePhone":"13763286281", 
       "phone":"(021)33674998-2130", 
       "shortPhone":"6338", 
       "gender":"男", 
       "sortNumber":10, 
       "organizationId ":"5837e952e0095f13208dj398" 
   }] 
 }

api.getOrganizationsOfUser (userId, sessionId, fun(){}) 其中fun()函数是一个返回Promise对象的函数,返回结果如下:

 { 
   "result": "success",  
   "failedMessage": "",  
   "organizations":[{  
     "id":"5837e952e0095f1320eae372", 
     "name":"金桥信息", 
     "parentId ":"", 
     "sortNumber":1 
   },{ 
     "id":"5837e952e0095f13208dj398", 
     "name":"技术中心", 
     "parentId ":"5837e952e0095f1320eae372", 
     "sortNumber":1 
   }] 
 } 

api.getContactersOfUser (userId, sessionId, orgnizationId, fun(){}) 其中fun()函数是一个返回Promise对象的函数,返回结果如下:

 { 
   "result": "success",  
   "failedMessage": "",  
   "users":[{ 
       "id":"5837e952e0095f1320eae338", 
       "userName":"zhangbin199", 
       "name":"张滨", 
       "email":"[email protected]", 
       "mobilePhone":"13763286281", 
       "phone":"(021)33674998-2130", 
       "shortPhone":"6338", 
       "gender":"男", 
       "sortNumber":10, 
       "organizationId ":"5837e952e0095f13208dj398" 
   }] 
 }

##License gbunityapi is licensed under the MIT.