Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jonabrams/node-shorty

Node.JS package for generating short URL paths based on a given counter. Based on django-shorty.
https://github.com/jonabrams/node-shorty

Last synced: about 1 month ago
JSON representation

Node.JS package for generating short URL paths based on a given counter. Based on django-shorty.

Awesome Lists containing this project

README

        

# node-shorty

A simple node.js package that will generate tinyurl/bit.ly style URL paths given number.

This is useful if your webapp needs to generate shortened URLs. Just keep track of the number of shortened URLs generated and pass the counter into _url\_encode_. Then, pass an encoded path into _url\_decode_ to find out the counter that was used to generate the URL path.

## Setting your own "alphabet"

By default, only alphanumeric characters are used for generating URL paths. If you would like a different set. Just call _set\_alphabet_, passing in your string of desired characters, just after loading the module.

## Example

See my open source URL shortener, [wiqr](http://github.com/JonAbrams/wiqr), written for node.js.