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: 12 months ago
JSON representation
Node.JS package for generating short URL paths based on a given counter. Based on django-shorty.
- Host: GitHub
- URL: https://github.com/jonabrams/node-shorty
- Owner: JonAbrams
- License: mit
- Created: 2012-04-21T19:22:04.000Z (about 14 years ago)
- Default Branch: master
- Last Pushed: 2013-04-16T04:17:33.000Z (about 13 years ago)
- Last Synced: 2025-03-17T07:10:00.378Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 101 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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.