# chl.li

> JavaScript Client for Chl.li url shortening api.

Latest version **0.1.3** (published 2020-08-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install chl.li
pnpm add chl.li
yarn add chl.li
bun add chl.li
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.3 |
| Published | 2020-08-20 |
| First published | 2020-05-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 8.9 KB |
| Known vulnerabilities | 0 (+25 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Venomaze |
| Maintainers | venomaze |
| Keywords | url, shortener, url shortener, shorten, api, chl.li |

## Links

- npm: https://www.npmjs.com/package/chl.li
- Repository: https://github.com/venomaze/chl.li
- Homepage: https://github.com/venomaze/chl.li#readme
- Issues: https://github.com/venomaze/chl.li/issues
- npm.io page: https://npm.io/package/chl.li

## Dependencies (2)

- [axios](https://npm.io/package/axios.md) ^0.19.2
- [is-url](https://npm.io/package/is-url.md) ^1.2.4

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 0.1.3 (latest) — 2020-08-20
- 0.1.2 — 2020-08-04
- 0.1.1 — 2020-08-04
- 0.1.0 — 2020-05-29

## README

# Chl.li JavaScript client

> A JavaScript client for [Chl.li](https://chl.li) url shortening api.

This package uses [Axios](https://github.com/axios/axios) for HTTP requests.

## Installation

To install this package you can either use [npm](https://npmjs.com/package/chl.li) or GitHub:

```
npm install chl.li
or
git clone https://github.com/venomaze/chl.li.git
```

## Usage

We have two main methods, the first one is `shorten` and the second one is `shortenMany`.  
The first one is used to shorten just **one** URL at a time. Example:

```js
const shortener = require('chl.li');

shortener
  .shorten('https://google.com', {
    timeout: 5000,
    alias: 'google',
    expires: 15, // Minutes
  })
  .then(shortURL => console.log(`The short url is ${shortURL}`))
  .catch(err => console.log(err.message));
```

The second one can be used to shorten **multiple** URLs together. Example:

```js
const shortener = require('chl.li');

shortener
  .shortenMany(
    [
      {
        url: 'https://google.com/',
        alias: 'google',
      },
      {
        url: 'https://yahoo.com',
        alias: 'yahoo',
        expires: 10, // Minutes
      },
    ],
    {
      timeout: 5000,
    }
  )
  .then(shortURLs => {
    shortURLs.forEach(console.log);
  })
  .catch(err => console.log(err.message));
```

---
_Source: https://npm.io/package/chl.li · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
