npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

kutt

v3.0.2

Published

Node.js & browser (TypeScript) client for Kutt url shortener

Downloads

554

Readme

Kutt

Node.js & browser (TypeScript) client for Kutt url shortener.

NPM Version Test NPM Monthly Downloads NPM Total Downloads NPM Bundle Size (minified) NPM Bundle Size (minified + gzip) Known Vulnerabilities Pull Requests License Github Stars Github Forks

Table of Contents

Installation

npm i kutt

Usage

CommonJS

const Kutt = require("kutt").default;

or

const { Kutt } = require("kutt");

ECMAScript

import Kutt from "kutt";

or

import { Kutt } from "kutt";

Default Config

Get

const api: string = Kutt.get("api");

const key: string = Kutt.get("key");

const timeout: number = Kutt.get("timeout");

Set

Kutt
  .set("api", "https://kutt.it/api/v2") // API base url (Default value)
  .set("key", "") // API key (Default value)
  .set("timeout", 1e4); // Request timeout (Default value)

Instance

const kutt = new Kutt();

Instance Config

Override the default config only for the instance.

Get

const api: string = kutt.get("api");

const key: string = kutt.get("key");

const timeout: number = kutt.get("timeout");

Set

kutt
  .set("api", "https://kutt.it/api/v2") // API base url
  .set("key", "") // API key
  .set("timeout", 1e4); // Request timeout

Domains

const domains = kutt.domains();

Create

Create a domain.

const domain = await domains.create({
  address: "string",
  homepage: "string",
});

Delete

Delete a domain.

const message = await domains.remove(domain.id);

Health

const health = kutt.health();

Check

Check API health.

const isHealthy = await health.check();

Links

const links = kutt.links();

List

Get list of links.

const result = await links.list();

You can also pass in pagination params.

const result = await links.list({
  skip: 0, // Default value
  limit: 10, // Default value
  all: 10, // Default value
});

Create

Create a short link.

const link = await links.create({
  target: "string",
  description: "string",
  expire_in: "2 minutes/hours/days",
  password: "string",
  customurl: "string",
  reuse: false,
  domain: "string",
});

Stats

Get link stats.

const stats = await links.stats(link.id);

Update

Update a link.

const updatedLink = await links.update(link.id, {
  target: "string",
  address: "string",
  description: "string",
  expire_in: "2 minutes/hours/days",
});

Delete

Delete a link.

const message = await links.remove(link.id);

Users

const users = kutt.users();

Info

Get user info.

const info = await users.info();

Versioning

We use SemVer for versioning. For the versions available, see the releases on this repository.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE file for details