YunPian SDK For Node.js
云片注册地址: https://www.yunpian.com/component/reg?inviteCode=atevkh
Minimum, Flexible, Scalable.
支持Lazy Require。
Table of Contents generated with DocToc
安装和使用
国际惯例:
npm install yunpian-sdk --save
公共参数:
var options = apikey: 'xxxxxxx';
ES7:
;const user = apikey: 'xxxx';// Within Async Funcasync const result = await user; // xxxx;
ES5:
var YUNPIAN = ;// 加载全部方法var user = apikey: 'xxxx';// 或加载某些方法var user = apikey: 'xxxx' 'get' 'set';// 或加载某个方法var user = apikey: 'xxxx' 'get';user;
手机号合法性校验
ES7 示例代码:
; // 加区号匹配国际各国号码格式; // true; // true; // false // 不加区号按中国号码匹配; // true; // false // 按地区匹配// 地区码使用3位缩写国家代码(大写); // true; // true; // false; // false
ES5 示例代码:
var phone = phone; ; // true; // true; // true
已支持的接口
USER - 账户API
API文档参考: https://www.yunpian.com/api2.0/user.html
ES7 示例:
; const user = apikey: 'xxxx'; async const user = await user; // xxxx const result = await user; // xxxx;
TPL - 模板API
API文档参考: https://www.yunpian.com/api2.0/tpl.html
SMS - 短信API
API文档参考: https://www.yunpian.com/api2.0/sms.html
ES7 示例:
; const sms = apikey: 'xxxx'; async console;;
VOICE - 语音API
API文档参考: https://www.yunpian.com/api2.0/voice.html
FLOW - 流量API
API文档参考: https://www.yunpian.com/api2.0/flow.html
License
MIT
通过支付宝捐赠: