Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rubiin/url-minify
Js library to shorten urls
https://github.com/rubiin/url-minify
nodejs npm shortner shortnerurl url url-shortener
Last synced: 2 months ago
JSON representation
Js library to shorten urls
- Host: GitHub
- URL: https://github.com/rubiin/url-minify
- Owner: rubiin
- Created: 2021-07-14T16:20:10.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-10-23T17:22:09.000Z (3 months ago)
- Last Synced: 2024-10-24T23:12:42.442Z (3 months ago)
- Topics: nodejs, npm, shortner, shortnerurl, url, url-shortener
- Language: TypeScript
- Homepage:
- Size: 843 KB
- Stars: 10
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Minify Url
> Library to make url shorter
# INSTALLAION
```sh
npm i url-minify
yarn add url-minify
```# USAGE
Currently 12 providers are supported
For typescript
```ts
import minify from 'url-minify';~(async function () {
console.log(
await minify('https://rubiin.vercel.app', { provider: 'isgd' }),
);// ==> {longUrl: 'https://rubiin.vercel.app',shortUrl: 'https://is.gd/PTkruq'}
})();
```For plain js
```js
const minify = require('url-minify').default;~(async function () {
console.log(
await minify('https://rubiin.vercel.app', { provider: 'isgd' }),
);// ==> {longUrl: 'https://rubiin.vercel.app',shortUrl: 'https://is.gd/PTkruq'}
})();
```## API
### minify(link,options)
#### options
Type: `object`
##### provider
Type: `string`
Service to use for shortening links. Defaults to `isgd`
Available providers: `''isgd' | 'cdpt' | 'vgd' | '4hnet' | 'tinube' | 'rbgy' | 'vurl' | 'haha' | 'pwm' | 'cya' | 'hideuri`##### timeout
Type: `number`
Response timeout in milliseconds. Defaults to `2000`
# Providers supported
Url shortner supports the following providers.
| Provider | Status |
| ----------- | ------ |
| is.gd | ✔️ |
| cdpt.in | ✔️ |
| tinu.be | ✔️ |
| v.gd | ✔️ |
| rb.gy | ✔️ |
| 4h.net | ✔️ |
| vurl.com | ✔️ |
| pwn.se | ✔️ |
| haha.se | ✔️ |
| cya.se | ✔️ |
| hideuri.com | ✔️ |
| tny.im | ✔️ |## Contributing
Any types of contributions are welcome. Feel free to send pull requests or create issues.
## License
Licensed under [The MIT License](LICENSE).