URL Shortener is a Node.js library that helps you shorten URLs.
You can install the URL Shortener library via npm:
npm install @hocinemk/urlz
const urlshortenerfunc = new urlshortener();
const shorturl = urlshortenerfunc.shorten('https://www.exemple.com/testmock', 'https://www.exemple.com');
you can setup how many characters you want in length by :
const urlshortenerfunc = new urlshortener({ shortidLength: 3 });
const urlshortenerfunc = new urlshortener({ shortidLength: 8 });
const shorturl = urlshortenerfunc.shorten('https://www.exemple.com/testmock', 'https://www.exemple.com');