npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

fast-two-sms

v3.0.0

Published

The Module to send Message using FAST2SMS.com

Downloads

2,821

Readme

The Module to send Message using FAST2SMS.com

🏠 Homepage

Installation

Download node at nodejs.org and install it, if you haven't already.

npm install fast-two-sms --save

This package is provided in these module formats:

  • CommonJS

Usage

const fast2sms = require('fast-two-sms')

var options = {authorization : YOUR_API_KEY , message : 'YOUR_MESSAGE_HERE' ,  numbers : ['9999999999','8888888888']} 
fast2sms.sendMessage(options) //Asynchronous Function.

Other than Above You may also use following options for more control.


You may also set the other FAST2SMS options :-
method    -     Method for request (Default : POST)
sender_id -     A custom name for SMS sender (Default: FSTSMS)
language  -     english / unicode (Unicode supports other languages such as Hindi) (Default: english)
route     -     p for promotional and t for transactional (Default: p)
flash     -     This field is optional, it will use "0" as default value or you can set to "1" for sending flash message. 
showLogs  -     Default is 'true'. Recommended to not set this explicitly. Set this to false if you don't want any log message to be printed.

You can also send Quick Transanctional Message using this module, read about Quick transactional API for Fast2sms here - [fast2sms.com/quick-transactional-api]{https://docs.fast2sms.com/#quick-transactional-api}

To send 'Quick Transactional' Messages change the following options :-
route            -     qt
variables        -     Variables used like: "{#AA#}|{#EE#}|{#CC#}" seperated by pipe "|".
variables_values -     Above variables values like: "Rahul|8888888888|6695" seperated by pipe "|".

Get Response Object

If you have explicitly defined showLogs and set it to 'false', it is highly recommended to get the response object from the server to verify the status.

To recieve the response object use then(), as shown:

    fast2sms.sendMessage(options).then(response=>{
      console.log(response)
    })

If you prefer async/await, it can be done by wrapping the code in an asynchronous function.

    async function smsSend(options){
      const response = await fast2sms.sendMessage(options)
      console.log(response)
    }

Get Wallet Balance

You can now, fetch your wallet balance using this module just call the function getWalletBalance(authorization: String)

const {wallet} = await fast2sms.getWalletBalance(authorization) //{returns {return:true, wallet: XX.XX}}

Installing Older Version

:warning : ** From V2.0.0 Contains some breaking changes.To download older version run the following command**:

  npm install [email protected] --save

Author

👤 Ashutosh Kumar

🤝 Contributing

Contributions, issues and feature requests are welcome!Feel free to check issues page. You can also take a look at the contributing guide.

Show your support

Give a ⭐️ if this project helped you!

📝 License

Copyright © 2020 raxraj. This project is MIT licensed.