tw-sms
v1.0.5
Published
[![Version npm](https://img.shields.io/npm/v/tw-sms.svg)](https://www.npmjs.com/package/tw-sms)
Downloads
9
Readme
tw-sms
trend wood sms module.
install
npm install tw-sms
set up
development env
you can create config.js
.
and then, add some config in it, just like below:
module.exports = {
sms_opts: {
apikey: 'your apikey' // get key from www.yunpian.com
}
};
production env
you don't need config sms's apikey anymore.
and you should start node like this:
SMS_KEY=yourkey node app.js
usage
var config = require('config');
var tw_sms = require('tw-sms')(config.sms_opts.apikey);
// sms send
let options1 = {
mobile: '18523975118',
text: '您的验证码是5201314'
};
tw_sms.send(options1, callback);
// sms get reply
let options2 = {
start_time: '2015-12-25 00:00:00',
end_time: '2015-12-30 00:00:00',
page_num: 1,
page_size: 100
}
tw_sms.getReply(options2, callback);
// sms get record
let options3 = {
start_time: '2015-12-25 00:00:00',
end_time: '2015-12-30 00:00:00',
page_num: 1,
page_size: 100
}
tw_sms.getReply(options3, callback);
documents
test
npm install
npm test