Socket
Socket
Sign inDemoInstall

chl.li

Package Overview
Dependencies
5
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    chl.li

JavaScript Client for Chl.li url shortening api.


Version published
Weekly downloads
2
decreased by-50%
Maintainers
1
Install size
437 kB
Created
Weekly downloads
 

Readme

Source

Chl.li JavaScript client

A JavaScript client for Chl.li url shortening api.

This package uses Axios for HTTP requests.

Installation

To install this package you can either use npm 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:

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:

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));

Keywords

FAQs

Last updated on 20 Aug 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc