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

dialog-sms-service

v1.1.3

Published

Javascript library for send sms using dialog SMS gateway

Downloads

113

Readme

Dialog SMS Service

JavaScript library to send SMS through Dialog telecommunication service

This library will handle single or multiple SMS send feature with Dialog telecommunications service.

npm install dialog-sms-service

Usage

const smsGateway = require('dialog-sms-service');

(async () => {
  try {
    // set configuration
    await smsGateway.setConfig({
      digest: 'dialog_msg_digest_here',
      mask: 'dialog_msg_mask_here',
      user: 'dialog_msg_user_here',
      campaignName: 'dialog_msg_campaignName_here', //optional
    });

    //send message
    const result = await smsGateway.sendSMS('07XXXXXXXX', 'Dialog sms test');
    console.log(result);
  } catch (error) {
    console.log(error);
  }
})();

How to work

First needs to contact Dialog Axiata PLC to get credentials for the SMS gateway.

Note:- Please contact Dialog Axiata PLC in order to obtain following fields.

| Field | Description | | -------- | ------------------------------------------------------------- | | Username | User name for the Dialog SMS gateway account. | | Password | Password for the Dialog SMS gateway account. | | mask | Text that appears as the sender of the SMS. Eg:- PIZZAHUT |

set configurations for the SMS gateway

// set configuration
await smsGateway.setConfig({
  digest: 'dialog_msg_digest_here',
  mask: 'dialog_msg_mask_here',
  user: 'dialog_msg_user_here',
  campaignName: 'dialog_msg_campaignName_here', //optional
});

| Field | Description | | ------------ | ------------------------------------------------------------------------------------------------------------------------------ | | user | Required. Username that will provided by Dialog. | | mask | Required. A String. SMS sender ID.Mask value provided by Dialog. Eg:- test (For the test account) | | digest | Required. md5 encripted values of password. {digest = md5(password provided by dialog)} | | campaignName | Optional. Campaign name to be used in reporting. |

Send SMS

await smsGateway.sendSMS(Phone Number ,Message);

| Field | Description | | ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Phone Number | Required. A String. Phone number/s which will need to receive SMS. the phone number needs to either start with 0 or 94 (do not use +94). If there are multiple receivers make sure to add them as comma (,) separated text. Eg :- '0771111111,0712222222' | | Message | Required. A String. The content of the SMS goes here. |

Licence

(The MIT License) Copyright (c) 2021 [email protected]