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

bm-sms

v0.2.14

Published

BMQB SMS package

Downloads

6

Readme

bm-sms 贝米钱包第三方短信发送SDK

npm version Build Status

安装:

npm install bm-sms --save

使用方式:

####1. 必要配置:

{
  'smser': 'yuntongxin',
  'debug': true,
  'config': {
  	...
  }
}
  • smser: 指定发送渠道
  • config: 发送渠道必要配置(接口鉴权等必要配置信息)
  • debug: [可选], 为true时,将在命令行输出接口请求详细信息

####2. 调用方式:

//以yuntongxin为例
const options = {
  'smser': 'yuntongxin',
  'config': {
    'sandbox': true,
    'account_sid': '00000000000000000000000000000000',
    'auth_token': '00000000000000000000000000000000',
    'app_id': '00000000000000000000000000000000',
    'vcode_template_id': 1,
    'vcode_timeout_min': 10,
  },
};

const sms = new BmqbSms(options);
sms.sendVcode('13871451762', '你的验证码是...').then(res => {
  console.log(res);
});

####3. API:所有API均以Promise对象作为返回结果。

  • sendVcode(mobile, msg): 发送短信验证码
  • sendSms(mobile, msg): 单条短信发送
  • sendVoiceVcode(mobile, code): 发送语音验证码,支持云通信和大汉三通
  • sendPkg(pkg): 群发,强制限定每次发送条数不得超过 1000 条,请注意分片发送。格式为:
[
  {
	"phone": "手机号1",
	"context": "%E6%B5%8B%E8%AF%950"
  },
  {
	"phone": "手机号2",
	"context": "%E6%B5%8B%E8%AF%951"
  },
  {
	"phone": "手机号3",
	"context": "%E6%B5%8B%E8%AF%952"
  }
]

NOTICE: 不支持某种发送方式的渠道,当调用该种方式API时,将会抛出异常!

####4. 返回结果: 约定返回结果为一个SmsResponse对象,该对象有以下属性:

  • status: 请求状态(success|failed)
  • ssid: 发送批次号
  • body: 接口原始响应结果

通过promise.then捕获返回结果