UNPKG

vitusvet-shorturl

Version:

Vitusvet package for URL shortener with bit.ly

10 lines (8 loc) 322 B
const BitlyClient = require('bitly').BitlyClient; const shortURL = async (accessToken, url) => { const bitly = new BitlyClient(accessToken); const response = await bitly.shorten(url); console.log(`Your shortened bitlink is ${response.url}`); return response.link; } module.exports = { shortURL }