1.0.1 • Published 2 years ago

ursh v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

URL Shortener API (Ursh)

Setup!

npm i ursh

Import the package!

const ursh = require("ursh");

Shorten A URL!

(async () => {
  let url = "https://foo.bar";
  let custom = "foobar";
  let response = await ursh.add(url, custom);
  console.log(response);
  /*{
      error: false,
      key: 'foobar',
      long: 'https://foo.bar',
      short: 'https://ursh.deta.dev/foobar',
      timestamp: 1663049744100
   }*/
})();

Get Details Of Shorten URL!

(async () => {
  let code = "foobar";
  let response = await ursh.get(code);
  console.log(response);
  /*{
      error: false,
      key: 'foobar',
      long: 'https://foo.bar',
      short: 'https://ursh.deta.dev/foobar',
      timestamp: 1663049744100
   }*/
})();