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

smsghjs

v0.4.0

Published

An SMSGH API JavaScript client library

Downloads

12

Readme

#SMSGHJS

Build Status

SMSGHJS uses JavaScript Standard Style

js-standard-style

The Standard JavaScript SDK for SMSGH API.

Still in development. You can check out the code and give reviews. I would appreciate that a lot. If there is any particular functionality you would like me to add just open an issue and I would check it out.

Check out the smsgh developers portal to see all the related API. It includes support for the Unified Services Payment, MESSAGING and TOP UP of the SMSGH API.

Documentation

Create an SMSGHJS instance

var SMSGH = require('smsghjs');

// get `clientId` and `clientSecret` from SMSGH
// `topupApiKey` is optional
// `uspToken` is optional
var sms  = new SMSGH({
  clientId: [clientId],
  clientSecret: [clientSecret],
  topupApiKey: [topupApiKey],
  uspToken: [uspToken]
})

sms.setContextPath('v3')

TOPUP

NOTE: The topup functionality will be deprecated soon. The same functionality is provided in the USP.

If you provided the topupApiKey when you were initialising sms, then the top up API will be made available.

sms.topUp.topItUp({
  phone: '233270000000',
  network: 'tigo',
  lineType: 0,
  amount: 5,
  method: 'GET'
}, function (err, res) {
  // handle the error
  if (err) {}
  // do something with response
})

SMS API

This section shows how to use the SMS API

var Message = SMSGH.Message
var newMessage = new Message({from: 'Me', to : '233272271893', content: 'Hello World'})

sms.messaging.send(newMessage, function (err, res) {
    if (err) // handle the Error
    // do something with the response
})

// Send a quick message
sms.messaging.sendQuickMessage('Me', '233272271893', 'Hello World', function (err, res) {})

// Send a scheduled message
var scheduledMessage = new Message({from: 'Me', to : '233272271893', content: 'Hello World', time: '2014-01-01 10:00:00'})
sms.messaging.sendScheduledMessage(scheduledMessage, function (err, res) {})

// Get the details of a message
// Provide `messageId` as first argument
sms.messaging.getMessage('6f19395db2fb497ea4ebd1e218dd3e4c', function (err, res) {})

// Query the message API
sms.messaging.queryMessage({index: 100, limit: 2}, function (err, res){})

// Reschedule a message
sms.messaging.rescheduleMessage('6f19395db2fb497ea4ebd1e218dd3e4c', '2014-01-01 05:00:00', function (err, res) {})

// Cancel a message
sms.messaging.cancelMessage('6f19395db2fb497ea4ebd1e218dd3e4c', function (err, res) {})

USP API

Docs coming up soon....

Made with ❤ by Eugene Asiedu in Ghana.