URL Shortener
NodeJS module to create aliases (using Base62 conversion) for long url mapped to a unique counter. Users are redirected to the original URL when they hit these short links.
Want to contribute to url-shortner? Please read CONTRIBUTING.md
.
Technologies used
- NodeJS
- MongoDB
Installation
URL-Shortener supports stable versions of Node.js 8.11.0 and later. You can install
URL-Shortener in your project's node_modules
folder.
To install the latest version on npm locally and save it in your package's
package.json
file:
npm install --save node-url-shorten
Usage
- Initialize URL Shortener Object
const URLShortener = ; const options = characters: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" minHashCount: 4 domain: "https://click.com" const shortUrl = mongodb errorCallback options;
- Shorten URL
shortUrl ;
- Retrieve Long URL from hash
shortUrl ;
Documentation
- Documentation is available at URL Shortener Docs.
License
URL Shortener is copyright (c) 2019-present Anish Lushte and the contributors to URL Shortener.
URL Shortener is free software, licensed under the MIT License. See the
LICENSE
file for more details.