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

clockwork

v0.1.4

Published

Mediaburst Clockwork API wrapper

Downloads

1,966

Readme

node-clockwork

Install

npm install clockwork

Simple Usage

var clockwork = require('clockwork')({key:'your clockwork key here'});


// Send a message
clockwork.sendSms({ To: '447123456789', Content: 'Test!'}, function(error, resp) {
    if (error) {
    	console.log('Something went wrong', error);
	} else {
		console.log('Message sent to',resp.responses[0].to);
		console.log('MessageID was',resp.responses[0].id);
	}
});

Getting an api key

First, head over to clockwork and signup if you're not already signed up. Once signed up, log in to your clockwork account and add a new API Key (from the top menu choose Sending -> API Keys).

Sending A Message

You can send a single message as shown above. If you have multiple messages to send, it's much more efficient to send them in bulk by passing an array of messages to sendSms:

clockwork.sendSms([{ To: '447123456789', Content: 'Test!'},
				   { To: '447123456781', Content: 'Another one'}], function(error, resp) {
    if (error) {
    	console.log('Something went wrong', error);
	} else {
		console.log('Messages sent');
	}
});

The second argument to sendSms is callback that you provide. The callback will be called with 2 json objects, error and response. If a general error occurs, then error will look like this:

{
	success: false,
	errNo: X,
	errDesc: 'Error description here'
}

Otherwise, error will be null, and the response will contain an array of sms responses, one for each message sent. In the example above where 2 messages were sent, assuming nothing went wrong, the response will look like this:

{
	responses: [
		{to: '447123456789', success: true, id: 'MessageId', errNo: '', ErrDesc: ''},
		{to: '447123456781', success: true, id: 'MessageId', errNo: '', ErrDesc: ''}
	]	
}

Currently, the nodejs wrapper only supports setting the to, from and content of sms messages. If you need to set other options, raise an issue in github and we'll try to get it done for you. For more information about sending messages and the responses, see the clockwork sms api documentation

Getting Your Balance

clockwork.getBalance(function(error, credit) {
    if (error) {
    	console.log('Something went wrong', error);
	} else {
		console.log('Your balance',credit);
	}
});

Again, if a general error occurs then error will be populated accordingly. Otherwise, the response contains your credit, in a format similar to this:

{
	accountType: 'PAYG',
	currency: {code: 'USD', symbol: '$'},
	balance: '100.0'
}