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 🙏

© 2024 – Pkg Stats / Ryan Hefner

neteasy-sms

v1.0.3

Published

sms package

Downloads

7

Readme

NETEASY-SMS 网易云信对接模块

方便快速接入网易短信服务而开发

1.install 安装
npm install neteasy-sms --save
2.init 初始化
const nesms = requrie("neteasy-sms");//引入包
nesms.init(yourAppKey,yourAppSecret);//初始化云信平台
3.API 相关方法

3.1 发送验证码

smscode(obj)

参数obj属性说明:

属性 | 类型 | 必须 | 说明 ---|---|---|---|--- mobile | String | Y | 目标手机号,非中国大陆手机号码需要填写国家代码(如美国:+1-xxxxxxxxxx)或地区代码(如香港:+852-xxxxxxxx) deviceId | String | N | 目标设备号,可选参数 templateid | int | N | 模板编号(如不指定则使用配置的默认模版) codeLen | int | N | 验证码长度,范围4~10,默认为4 authCode | int | N | 如果设置了该参数,则codeLen参数无效 needUp | Boolean | N | 是否需要支持短信上行。true:需要,false:不需要说明:如果开通了短信上行抄送功能,该参数需要设置为true,其它情况设置无效

范例:

const nesms = requrie("neteasy-sms");//引入包
nesms.init(yourAppKey,yourAppSecret);//初始化云信平台
nesms.smscode({
    mobile:13755550000,//验证的手机号码        
}).then(res=>{
    console.log(res)//打印发送后的回执
})

3.2 发送短信模板消息

smstemp(obj)

参数obj属性说明:

属性 | 类型 | 必须 | 说明 ---|---|---|---|--- templateid | int | Y | 模板编号(由客户顾问配置之后告知开发者) mobiles | String | Y | 接收者号码列表,JSONArray格式,如["186xxxxxxxx","186xxxxxxxx"],限制接收者号码个数最多为100个; 非中国大陆手机号码需要填写国家代码(如美国:+1-xxxxxxxxxx)或地区代码(如香港:+852-xxxxxxxx) params | String | N |模板中若含变量则必须包含此参数短信参数列表,用于依次填充模板,JSONArray格式,每个变量长度不能超过30字,如["xxx"," needUp | Boolean | N | 是否需要支持短信上行。true:需要,false:不需要 说明:如果开通了短信上行抄送功能,该参数需要设置为true,其它情况设置无效

vcode://类【校验验证码】

详细见网易短信接口文档

qcsms://类【查询通知类和运营类短信发送状态】

详细见网易短信接口文档