Skip to content

Commit 1638e8f

Browse files
committed
Readme Updated
1 parent c3e0625 commit 1638e8f

File tree

1 file changed

+30
-4
lines changed

1 file changed

+30
-4
lines changed

README.md

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ The Module to send Message using FAST2SMS.com
2121

2222
### 🏠 [Homepage](https://github.com/raxraj/fast2sms#readme)
2323

24+
:warning: **V2.0.0 Contains some breaking changes.To download older version get to the bottom of this page.**:
2425

2526
## Installation
2627
Download node at [nodejs.org](http://nodejs.org) and install it, if you haven't already.
@@ -39,22 +40,47 @@ This package is provided in these module formats:
3940
const fast2sms = require('fast-two-sms')
4041

4142
var options = {authorization : YOUR_API_KEY , message : 'YOUR_MESSAGE_HERE' , numbers : ['9999999999','8888888888']}
42-
fast2sms.sendMessage(options)
43-
43+
fast2sms.sendMessage(options) //Asynchronous Function.
4444
```
45-
4645
Other than Above You may also use following options for more control.
4746

48-
```sh
47+
```
4948
5049
You may also set the other FAST2SMS options
5150
method - Method for request (Default : POST)
5251
sender_id - A custom name for SMS sender (Default: FSTSMS)
5352
language - english / unicode (Unicode supports other languages such as Hindi) (Default: english)
5453
route - p for promotional and t for transactional (Default: p)
5554
flash - This field is optional, it will use "0" as default value or you can set to "1" for sending flash message.
55+
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.
5656
5757
```
58+
# Get Response Object
59+
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.
60+
61+
To recieve the response object use then(), as shown:
62+
63+
```js
64+
fast2sms.sendMessage(options).then(response=>{
65+
console.log(response)
66+
})
67+
```
68+
69+
If you prefer async/await, it can be done by wrapping the code in an asynchronous function.
70+
71+
```js
72+
async function smsSend(options){
73+
const response = await fast2sms.sendMessage(options)
74+
console.log(response)
75+
}
76+
```
77+
78+
## Installing Older Version
79+
80+
```sh
81+
npm install fast-two-sms@1.0.4 --save
82+
```
83+
5884
## Author
5985

6086
👤 **Ashutosh Kumar**

0 commit comments

Comments
 (0)