An open API service indexing awesome lists of open source software.

https://github.com/varundeva/shrtfly

shrtfly - Url Shortner [Unofficial NPM Package]
https://github.com/varundeva/shrtfly

shrtfly shrtflynpm

Last synced: 10 months ago
JSON representation

shrtfly - Url Shortner [Unofficial NPM Package]

Awesome Lists containing this project

README

          

## shrtfly - Url Shortner [Unofficial Package]

# What's the .env variables?
- Two .env required, one is optional
- You can also refer [.env Example](https://github.com/varundeva/shrtfly/blob/main/.env-example)
```
SHRTFLY_KEY=YOUR_API_KEY
//This must be added in shrtfly.com account
SHRTFLY_ALIAS=youralias.com
```
- You can create api key at [Shrtfly - URL Shortner](https://shrtfly.com/ref/freesv)
# How to Use?
- Install package using Inline `npm i shrtfly`
- Import package `import {shortUrl} from "shrtfly"`
- Use it Like
```
const longUrl = 'http://yourdomain.com'
const url = shortUrl(longUrl)
```
- Done

# To-do
- Ad preferences
- Your custom alias -> Mainstream is default now.
- Mainstream: 1
- Adult: 2
- Response format -> JSON/TEXT. Currently, JSON is the default.