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

ming-dingtalk

v0.0.8

Published

dingdingSDK

Downloads

21

Readme

ming-dingtalk

dingdingSDK

const DingTalk = require('ming-dingtalk');

dingtalk=new DingTalk({
    corpId:"xx",
    corpSecret:"xx",
    ssoSecret:"xx",
    appkey: 'xx',
    appsecret: 'xxx',
    agentId:12345,
    sweepCodeLoginAppID:"xxx", //扫码登陆的appId
    sweepCodeLoginAppsecret:"xxxxxx"// //扫码登陆的Appsecret
})

//获取accessToken
if(0)
dingtalk.auth.getToken().then(res => console.log(res));



//获取用户详情
dingtalk.user.get("manager6712").then(res => console.log(res.data));
//获取部门用户userid列表
//dingtalk.user.getDeptMember("71433174").then(res => console.log(res.data));
//获取部门用户
//dingtalk.user.simplelist({department_id:"71433174",offset:0,size:5}).then(res => console.log(res.data));
//获取部门用户详情
//dingtalk.user.listbypage({department_id:"71433174",offset:0,size:5}).then(res => console.log(res.data));
//获取管理员列表
//dingtalk.user.get_admin().then(res => console.log(res.data));
//获取管理员通讯录权限范围
//dingtalk.user.get_admin_scope("manager6712").then(res => console.log(res.data));
//根据unionid获取userid
//dingtalk.user.getUseridByUnionid("O6VquZgrammhMIIWPXM2egiEiE").then(res => console.log(res.data));

if(0)
dingtalk.user.getuserinfo("199a57636b713257b6ab002b2603ab1e").then(res => console.log(res.data));



//创建用户
if(0)
dingtalk.user.create({
    "userid": "zhangsan00",
    "name": "张三",
    "department": [71528142],
    "position": "产品经理",
    "mobile": "13325478946",
    "tel" : "xxxx-xxxxxxx",
    "workPlace" :"",
    "remark" : "",
    "email": "[email protected]",
    "orgEmail": "[email protected]",
    "jobnumber": "xxx",
    "isHide": false,
    "isSenior": false,
    "extattr": {
        "爱好":"旅游",
        "年龄":"24"
    }
}).then(res => console.log(res.data));



//更新用户
if(0)
    dingtalk.user.update({
        "userid": "zhangsan",
        "name": "张三4",
        "department": [71528142],
        "position": "产品经理",
        "mobile": "13325478946",
        "tel" : "xxxx-xxxxxxx",
        "workPlace" :"",
        "remark" : "",
        "email": "[email protected]",
        "orgEmail": "[email protected]",
        "jobnumber": "xxx",
        "isHide": false,
        "isSenior": false,
        "extattr": {
            "爱好":"旅游",
            "年龄":"24"
        }
    }).then(res => console.log(res.data));


//删除用户
if(0)
dingtalk.user.delete("zhangsan00").then(res => console.log(res.data));



//获取子部门ID列表
if(0)
dingtalk.department.list_ids("71528142").then(res => console.log(res.data));


//获取部门列表
if(0)
dingtalk.department.list({id:"71433174",fetch_child:true}).then(res => console.log(res.data));


//获取部门详情

if(0)
dingtalk.department.get("71433174").then(res => console.log(res.data));

//查询部门的所有上级父部门路径
if(0)
dingtalk.department.list_parent_depts_by_dept("71433174").then(res => console.log(res.data));


//查询指定用户的所有上级父部门路径
if(0)
dingtalk.department.list_parent_depts("manager6712").then(res => console.log(res.data));


//获取企业员工人数
if(0)
dingtalk.department.get_org_user_count().then(res => console.log(res.data));


//创建部门
if(0)
dingtalk.department.create(
    {
        "name": "钉钉事业部",
        "parentid": "1",
        "order": "1",
        "createDeptGroup": true,
        "deptHiding" : true,
        "deptPermits" : "3|4",
        "userPermits" : "userid1|userid2",
        "outerDept" : true,
        "outerPermitDepts" : "1|2",
        "outerPermitUsers" : "userid3|userid4",
        "sourceIdentifier" : "source"
    }
).then(res => console.log(res.data));




//更新部门
if(0)
dingtalk.department.update(
    {
        id:"114433438",
        "name": "钉钉事业部1",
        "parentid": "1",
        "order": "1",
        "createDeptGroup": true,
        "deptHiding" : true,
        "deptPermits" : "3|4",
        "userPermits" : "userid1|userid2",
        "outerDept" : true,
        "outerPermitDepts" : "1|2",
        "outerPermitUsers" : "userid3|userid4",
        "sourceIdentifier" : "source"
    }
).then(res => console.log(res.data));


if(0)
dingtalk.department.delete("114433438").then(res => console.log(res.data));


//获取角色列表
if(0)
dingtalk.role.list().then(res => console.log(JSON.stringify(res.data)));


//获取角色下的员工列表
if(0)
dingtalk.role.simplelist( {role_id:"327619019",size:20,offset:0}).then(res => console.log(res.data));

//获取角色组
if(0)
dingtalk.role.getrolegroup( "327619001").then(res => console.log(res.data));

//获取角色详情
if(0)
dingtalk.role.getrole(327619016).then(res => console.log(res.data));

if(0)
dingtalk.role.add_role({roleName:"系搜索5",groupId:327619006}).then(res => console.log(res.data));

if(0)
dingtalk.role.update_role({roleName:"系搜索1",roleId:447810818}).then(res => console.log(res.data));

//删除角色
if(0)
dingtalk.role.deleterole(447864441).then(res => console.log(res.data));


if(0)
dingtalk.role.add_role_group("名1").then(res => console.log(res.data));


if(0)
dingtalk.role.addrolesforemps({roleIds:"327619009,327619025",userIds:"manager6712"}).then(res => console.log(res.data));


//批量删除员工角色
if(0)
dingtalk.role.removerolesforemps({roleIds:"327619009,327619025",userIds:"manager6712"}).then(res => console.log(res.data));


//获取外部联系人标签列表
if(0)
 dingtalk.extcontact.listlabelgroups().then(res => console.log(res.data));


//获取外部联系人标签列表
if(0)
 dingtalk.extcontact.list().then(res => console.log(res.data));

//获取企业外部联系人详情

if(0)
dingtalk.extcontact.get("1918472868114179").then(res => console.log(res.data));

if(0)
dingtalk.sso.gettoken().then(res => console.log(res.data));

if(0)
dingtalk.sso.ming_getuserinfoByCode("121a2aabe42e3778af25201bf4c73cb7").then(res => console.log(res.data));

if(0)
dingtalk.sns.getuserinfo_bycode("ee2f9b56e1d53939aebf537466665011").then(res => console.log(res.data));


if(0)
    dingtalk.auth.getToken().then(res => console.log(res));




//获取二维码
if(0)
    dingtalk.sns.getQRParmasUrl().then(res => console.log(res));

if(0)
    dingtalk.sns.getSnstoken().then(res => console.log(res))



if(0)
    dingtalk.message.corpconversation_asyncsend_v2().then(res => console.log(res.data))


if(0)
    dingtalk.message.corpconversation_getsendprogress(35138977623).then(res => console.log(res.data))



if(0)
    dingtalk.message.corpconversation_getsendresult(35138977623).then(res => console.log(res.data))



if(0)
    dingtalk.jsapi.getTicket().then(res => console.log(res))


if(0)
dingtalk.jsapi.getJSConfig("https://github.com/").then(res => console.log(res))