Skip to content

Latest commit

 

History

History
36 lines (24 loc) · 1.33 KB

File metadata and controls

36 lines (24 loc) · 1.33 KB

TinyURL JavaScript Client

Contact me on Codementor Made in Indonesia Build Status

Easily use TinyURL in your browser.

Getting Started

  1. Install it

     $ npm install @kulkul/tinyurl-client
    
  2. Use it

import shortenUrl from "@kulkul/tinyurl-client";

shortenUrl("https://kulkul.tech").then((result) => {
    console.log({ result }); // https://tinyurl.com/<random-slug>
});

Important Note on Custom Aliases

Custom aliases are no longer supported. The underlying TinyURL API endpoint used by this client does not support custom aliases. Any alias parameter provided will be ignored, and a random slug will be generated instead.

import shortenUrl from "@kulkul/tinyurl-client";

// Alias parameter is deprecated and will be ignored
shortenUrl("https://kulkul.tech", "my-custom-alias").then((result) => {
    console.log({ result }); // https://tinyurl.com/<random-slug> (NOT my-custom-alias)
});