# Short Go

[![NPM Version](https://img.shields.io/npm/v/shortgo)](https://www.npmjs.org/package/shortgo)

## Table of Contents

- [Installation](#installation)
- [Usage](#usage)
- [Contributing](#contributing)
- [License](#license)

## Browser Support

![Chrome](https://raw.githubusercontent.com/alrra/browser-logos/main/src/chrome/chrome_48x48.png) | ![Firefox](https://raw.githubusercontent.com/alrra/browser-logos/main/src/firefox/firefox_48x48.png) | ![Safari](https://raw.githubusercontent.com/alrra/browser-logos/main/src/safari/safari_48x48.png) | ![Opera](https://raw.githubusercontent.com/alrra/browser-logos/main/src/opera/opera_48x48.png) | ![Edge](https://raw.githubusercontent.com/alrra/browser-logos/main/src/edge/edge_48x48.png) | ![IE](https://raw.githubusercontent.com/alrra/browser-logos/master/src/archive/internet-explorer_9-11/internet-explorer_9-11_48x48.png) |
--- | --- | --- | --- | --- | --- |
Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | 11 ✔ |

## Installation

### Package manager

Using npm:
```bash
$ npm install shortgo
```
Using yarn:
```bash
$ yarn add shortgo
```
Using pnpm:
```bash
$ 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

```js
import { ShortGo } from 'shortgo';
```

#### Starting the shortener

```js
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:

```json
{ "ok": true, "url": "https://is.gd/example", "slug": "example" }
```

###### If an error occurs, it will return this:

```json
{ "ok": false, "message": "" }
```

## Contributing
* [Contributing Guide]("https://github.com")


## 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.