1.7.1 • Published 8 years ago

mengwang v1.7.1

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

mengwang

Node.js SDK for mengwang sms SOAP.

Build Status semantic-release

Examples

import Mengwang from 'mengwang';

const mengwang = new Mengwang({
  username: '<Your userId>',
  userpass: '<Your password>'
});

mengwang.sendSms('13700000000', '我是内容').then((result) => {
  console.log(result);
}, (err) => {
  console.error(err);
});

Installation

$ npm install mengwang

Documents

Table of Contents

Class: Mengwang

This class is a wrapper for mengwang sms SOAP API

new Mengwang(options)

Construct a new mengwang object

options is an object with the following defaults:

{
  wsdl: 'http://61.145.229.29:9006/MWGate/wmgw.asmx?wsdl',
  pszSubPort: '*',
  debug: false,
  logger: () => {}
}

options's property list as below:

NametypeDescriptionRequirement
wsdlstringWSDLoptional
pszSubPortstringsub portoptional
usernamestringThe userIdrequired
userpassstringThe passwordrequired
debugboolDebug toggleoptional
loggerfunctionA logger handleroptional
proxystringProxy for someone behind a firewalloptional
timeoutintegerTimeout for requestoptional

logger function accept only one argument msg like

(msg) => {
  // do some thing...
}
NametypeDescriptionRequirement
msgstringLog messageoptional

mengwang.sendSms(mobile, content)

Send sms content to mobile

NametypeDescriptionRequirement
mobilestring/arrayUser's mobile to receive smsrequired
contentstringToken playedrequired

License

MIT License. See the LICENSE file.

1.7.1

8 years ago

1.7.0

8 years ago

1.6.0

8 years ago

1.5.1

8 years ago

1.5.0

8 years ago

1.4.1

8 years ago

1.4.0

8 years ago

1.3.0

8 years ago

1.2.0

8 years ago

1.1.0

8 years ago