Giter VIP home page Giter VIP logo

aliyun-sms's Introduction

阿里云短信服务 node-aliyun-sms

这是一个简单的调用阿里云短信服务的Node库, 仅仅需要调用一个函数,就可以调用阿里云的短信服务API。内部使用request-promise,所以函数的返回值为Promise。 此库默认仅用POST方式。

安装

npm i --save node-aliyun-sms

使用

const sendSms = require('node-aliyun-sms')

const responseAsPromise = sendSms({
  accessKeyId: '阿里云AccessKeyId',
  accessKeySecret: '阿里云AccessKeySecret',
  signName: '短信签名(例如:XX银行)',
  templateCode: '短信模板Code(例如:SMS_53710888)',
  to: '13312345678;13212345678',
  paramString: '{"code": "8888"}'
})

responseAsPromise.then(res => {
  console.log(res)
  /*
   * 控制台输出:
   * {"Model":"106353688047^1108634211787","RequestId":"E8C39EF0-7889-4D9F-B8B4-FE42FCD27DCB"}
   */
})

aliyun-sms's People

Contributors

87hz avatar

Watchers

James Cloos avatar 药水哥 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.