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 🙏

© 2026 – Pkg Stats / Ryan Hefner

nimbasms

v1.0.0

Published

A Node JS module for communicating with Nimba SMS API.

Downloads

615

Readme

nimbasms-node

A NodeJS module for communicating with Nimba SMS API.

Usage

Installation

npm install nimbasms

Check balance

const { Client } = require('nimbasms/client');

const config = {
    SERVICE_ID = 'XXXXXXXXXXX', 
    SECRET_TOKEN = 'YYYYYYYYYYYYYYYYYYY',
}

const client = new Client(config)

// Get your account balance
client.accounts.get()
    .then(account => {
        console.log(`My Account balance: ${account['balance']}`);
    })
    .catch(error => {
        console.log(error);
    })

Groups

const { Client } = require('nimbasms/client');

const config = {
    SERVICE_ID = 'XXXXXXXXXXX', 
    SECRET_TOKEN = 'YYYYYYYYYYYYYYYYYYY',
}

const client = new Client(config)

client.groups.list()
    .then(groups => {
      console.log(`There are ${groups.count} groups.`);
      // or
      // console.log(`There are ${groups.results.length} groups.`);
    })
    .catch(error => {
        console.log(error);
    })

Sendernames

const { Client } = require('nimbasms/client');

const config = {
    SERVICE_ID = 'XXXXXXXXXXX', 
    SECRET_TOKEN = 'YYYYYYYYYYYYYYYYYYY',
}

const client = new Client(config)

client.sendernames.list()
  .then(sendernames => {
      console.log(`There are ${sendernames.count} sendernames.`);
      for(let sendername of sendernames.results)  {
          console.log(sendername)
      }
  })
  .catch(error => {
      console.log(error);
  })

Create Contact

const { Client } = require('nimbasms/client');

const config = {
    SERVICE_ID = 'XXXXXXXXXXX', 
    SECRET_TOKEN = 'YYYYYYYYYYYYYYYYYYY',
}

const client = new Client(config)

// List of all contacts
client.contacts.list()
  .then(contacts => {
      console.log(`There are ${contacts.results.length} contacts.`);
      for(let contact of contacts.results) {
          console.log(contact);
      }
  })
  .catch(error => {
      console.log(error);
  })


// This contact will be added to the default contact list
const body = {
    numero: '224XXXXXXXXX'
}
client.contacts.create(body)
  .then(contact => {
        console.log(`A contact has been added : `, contact);
    })
    .catch(error => {
        console.log(error);
    });

// Create with groups and name - name and groups are optional.
const body = {
    numero: '224XXXXXXXXX',
    name: 'Foo',
    groups: ['API', 'Facebook Client'],
}

client.contacts.create(body)
    .then(contact => {
        console.log(`A contact has been added :`, contact);
    })
    .catch(error => {
        console.log(error);
    });

Messages

const { Client } = require('nimbasms/client');

const config = {
    SERVICE_ID = 'XXXXXXXXXXX', 
    SECRET_TOKEN = 'YYYYYYYYYYYYYYYYYYY',
}

const client = new Client(config)


// Get All messages
client.messages.list()
    .then(messages => {
        console.log(`There are ${messages.count} messages in your account.`);
    })
    .catch(error => {
        console.log(error);
    });

// Get only 10 last messages
client.messages.list({limit: 10})
    .then(messages => {
        console.log('Here are the last 10 messages in your account:')
        for( message of messages.results){
            console.log(message)
        }
    })
    .catch(error => {
        console.log(error);
    });

// Send a message
const body = {
  to: ['6XXXXXXXXX'], // The recepients
  message: 'Hello from Nimba SMS !', 
  sender_name: 'YYYYYYYYYY', // Replace with your sender name
}

client.messages.create(body)
  .then(message => {
      console.log(`A new message has been sent : `, message);
  })
  .catch(error => {
      console.log(error);
  });

// Retrieve a message's details
const messageId = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx';
client.messages.get(messageId)
  .then(message => {
    console.log('Got one message : ', message)
  })
  .catch(error => {
    console.log(error);
  });

Verifications

const { Client } = require('nimbasms/client');

const config = {
    SERVICE_ID = 'XXXXXXXXXXX', 
    SECRET_TOKEN = 'YYYYYYYYYYYYYYYYYYY',
}

const client = new Client(config)


// Send a verification request
const verification = {
    to: "+123456789",
    message: "Your verification code is: <1234>",
    expiry_time: 5,
};

client.verifications.create(verification)
    .then(response => {
        console.log("A verification request is issued: ", response);
    })
    .catch(error => {
        console.log(error);
    });


// Verify a verification request
const verificationParams = {
    verificationId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    code: "YYYY",
};

client.verifications.verify(verificationParams)
    .then(response => {
        console.log(response);
    })
    .catch(error => {
        console.log(error);
    })

Credit

Nimba SMS