Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/jonabrams/node-shorty
- Owner: JonAbrams
- License: mit
- Created: 2012-04-21T19:22:04.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2013-04-16T04:17:33.000Z (over 11 years ago)
- Last Synced: 2024-04-10T23:43:48.331Z (9 months ago)
- Language: JavaScript
- Homepage:
- Size: 101 KB
- Stars: 2
- Watchers: 3
- 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.