Home
Softono
url-minify

url-minify

Open source TypeScript
11
Stars
0
Forks
2
Issues
1
Watchers
1 week
Last Commit

About url-minify

Js library to shorten urls

Platforms

Web Self-hosted

Languages

TypeScript

Links

NPM version CI Downloads

Minify Url

Library to make url shorter

INSTALLAION

npm i url-minify
yarn add url-minify

USAGE

Currently 12 providers are supported

For typescript

import minify from "url-minify";

~(async function () {
  console.log(await minify("https://rubiin.vercel.app", { provider: "isgd" }));

  // ==> {longUrl: 'https://rubiin.vercel.app',shortUrl: 'https://is.gd/PTkruq'}
})();

For plain js

const minify = require("url-minify").default;

~(async function () {
  console.log(await minify("https://rubiin.vercel.app", { provider: "isgd" }));

  // ==> {longUrl: 'https://rubiin.vercel.app',shortUrl: 'https://is.gd/PTkruq'}
})();

API

minify(link,options)

options

Type: object

provider

Type: string

Service to use for shortening links. Defaults to isgd Available providers: ''isgd' | 'cdpt' | 'vgd' | '4hnet' | 'rbgy' | 'vurl' | 'haha' | 'pwm' | 'cya' | 'hideuri

timeout

Type: number

Response timeout in milliseconds. Defaults to 2000

Providers supported

Url shortner supports the following providers.

Provider Status
is.gd ✔️
cdpt.in ✔️
v.gd ✔️
rb.gy ✔️
4h.net ✔️
vurl.com ✔️
pwn.se ✔️
haha.se ✔️
cya.se ✔️
hideuri.com ✔️

Contributing

Any types of contributions are welcome. Feel free to send pull requests or create issues.

License

Licensed under The MIT License.