node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »



A simple URL shortener intended to be a drop in module replacement for or called as a simple service in Starphleet.

Example Usage

This can be used as an NPM module. The backend makes liberal use of the KV Store - so, as long as you have access to the KV Store you're golden. You will need to setup a few environment variables for the KV Store which can be found here. If you intend to use different values than the server make sure you know what you are doing.

A method has been exposed that is (hopefully) a drop-in replacement for the node module.

For Example:

var url = require('glg-url');
var _longUrl = "";
url.shorten(_longUrl,function(err,bitlyCompatibleResult) {
  if (err) {
    throw new Error(err);
  console.log("Short Url:",;
  // Short Url:

Using from the command line

There is an included command line tool. If you do not run with an "always on" dev environment file you will need to source a file with the appropriate KV Store variables. The command line version will error out without the environment variables set.

For Example:

➜  ~  npm install -g glg-url
➜  ~  source "${HOME}/.devenv"
➜  ~  glgurl -u ""


You can find REST documentation here

You will find NPM documentation here