1.0.5 • Published 8 years ago

tw-sms v1.0.5

Weekly downloads
7
License
ISC
Repository
-
Last release
8 years ago

tw-sms

Version npm

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
1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago