Shurly is a simple URL shortener package for Node.js. It allows you to generate short URLs for long ones, and also expand short URLs back to their original form.
You can install Shorturly via npm:
npm install shorturly
const Shorturly = require('shorturly');
// Create a new instance of Shorturly
const shortener = new Shorturly();
// Shorten a long URL
const originalUrl = 'https://www.example.com/very-long-url-to-be-shortened';
const shortUrl = shortener.shortenUrl(originalUrl);
console.log('Shortened URL:', shortUrl);
// Expand a short URL back to its original form
const expandedUrl = shortener.expandUrl(shortUrl);
console.log('Expanded URL:', expandedUrl);
This project is licensed under the MIT License - see the LICENSE file for details.