shortgo
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

Short Go

NPM Version

Table of Contents

Browser Support

Chrome Firefox Safari Opera Edge IE
Latest ✔ Latest ✔ Latest ✔ Latest ✔ Latest ✔ 11 ✔

Installation

Package manager

Using npm:

$ npm install shortgo

Using yarn:

$ yarn add shortgo

Using pnpm:

$ pnpm add shortgo

Usage

Once the package is installed, you can import the library using import or require approach:

If you use require for importing, only default export is available:

Import package

import { ShortGo } from 'shortgo';

Starting the shortener

import { ShortGo } from 'shortgo';

const isGd = new ShortGo('is.gd') // is.gd | v.gd

async function main() {
  try {
    const shortUrl = await isGd.shorten({
      url: "", // Main url
      slug: "", // Optional
      advancedLog: true, // False for default
    })

    console.log(shortUrl)
  } catch (error) {
    console.log(error)
  }
}

main()
If everything goes as expected, it returns this:
{ "ok": true, "url": "https://is.gd/example", "slug": "example" }
If an error occurs, it will return this:
{ "ok": false, "message": "" }

Contributing

  • Contributing Guide

License

MIT License

Copyright (©) 2024 OLIXY

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Package Sidebar

Install

npm i shortgo

Weekly Downloads

2

Version

1.0.4

License

MIT

Unpacked Size

21.4 kB

Total Files

15

Last publish

Collaborators

  • olixy