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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@plung/sdk

v0.2.0

Published

Official TypeScript SDK for the Plung API

Readme

Plung TypeScript SDK

Official TypeScript SDK for the Plung API.

Installation

pnpm add @plung/sdk

Quick start

import { PlungClient } from '@plung/sdk';

const client = new PlungClient(process.env.PLUNG_API_KEY!);

const { data, meta } = await client.links.create({
  url: 'https://example.com',
});

console.log(data.shortUrl);
console.log(meta.rateLimit.remaining);

Example response shape:

{
  data: {
    shortUrl: 'https://plu.ng/hello-world',
    shortCode: 'hello-world',
    url: 'https://example.com',
    createdAt: '2026-03-27T00:00:00.000Z'
  },
  meta: {
    apiKeyName: 'primary',
    rateLimit: {
      limit: 100,
      remaining: 99,
      reset: 1710000000
    },
    plan: 'PRO',
    usage: {
      apiCallsUsed: 1,
      apiCallsLimit: 1000,
      apiCallsRemaining: 999,
      reset: 1775001600
    }
  }
}

Available methods

| Resource | Method | Signature | | --- | --- | --- | | Links | links.create | (input: CreateLinkInput) => Promise<PlungResponse<Link>> | | Links | links.batchCreate | (items: CreateLinkInput[]) => Promise<PlungResponse<BatchCreateResponse>> | | QR | qr.get | (shortCode: string, options?: QrOptions) => Promise<QrResponse> | | Analytics | analytics.get | (shortCode: string) => Promise<PlungResponse<LinkStats>> |

Error handling

import {
  PlungAuthError,
  PlungRateLimitError,
  PlungValidationError,
  PlungClient,
} from '@plung/sdk';

const client = new PlungClient(process.env.PLUNG_API_KEY!);

try {
  await client.links.create({ url: 'not-a-valid-url' });
} catch (error) {
  if (error instanceof PlungValidationError) {
    console.log('Validation failed:', error.message);
  } else if (error instanceof PlungAuthError) {
    console.log('Authentication failed:', error.message);
  } else if (error instanceof PlungRateLimitError) {
    console.log('Rate limited:', error.retryAfter);
  }
}

Response metadata

Every successful SDK response includes a meta object.

  • meta.apiKeyName: API key label returned by the backend, when available.
  • meta.rateLimit.limit: Current rate-limit ceiling for the authenticated key.
  • meta.rateLimit.remaining: Remaining requests in the current rate-limit window.
  • meta.rateLimit.reset: Unix timestamp in seconds for the rate-limit reset time.
  • meta.plan: Current Plung plan identifier returned by the backend.
  • meta.usage.apiCallsUsed: API calls already used in the current billing period.
  • meta.usage.apiCallsLimit: API call limit for the current billing period, when finite.
  • meta.usage.apiCallsRemaining: Remaining API calls for the current billing period, when finite.
  • meta.usage.reset: Unix timestamp in seconds for the next usage reset time.

Requirements

  • Node >=24.14.1