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 🙏

© 2025 – Pkg Stats / Ryan Hefner

npms-io-client

v1.0.8

Published

A universal typed npms.io client

Readme

A universal typed npms.io api client.

Uses cross-fetch to support both node and browser environments.

Installation

yarn add npms-io-client
npm install npms-io-client

API

Search

import { getSearch } from "npms-io-client";

getSearch({ terms: "chalk" }).then((result) => {
  console.log(result);
  // {
  //   total: 423,
  //   results: [{
  //     package: {
  //       name: 'chalk',
  //       scope: 'unscoped',
  //       version: '4.1.0',
  //       ...
  //     },
  //     ...
  //   ]
  // }
});

Types:

getSearch(query: SearchQuery, from?: number, size?: number) => Promise<SearchResponse>;

type SearchQuery = {
  terms?: string | string[];
} & SearchQueryQualifiers;

type SearchQueryQualifiers = {
  scope?: string;             // Filter by scope
  author?: string;            // Filter by author
  maintainer?: string;        // Filter by maintainer
  keywords?: string;          // Filter by keywords (Separate multiple keywords with commas. You may also exclude keywords e.g: -framework).
  deprecated?: boolean;       // Filter by deprecated / not deprecated
  unstable?: boolean;         // Filter by unstable (< 1.0.0) / stable (> 1.0.0)
  insecure?: boolean;         // Filter packages with vulnerabilities
  boostExact?: boolean;       // Boost exact matches. Defaults to true.
  scoreEffect?: number;       // Set the effect that package scores have for the final search score, defaults to 15.3
  qualityWeight?: number;     // Set the weight that quality has for the each package score, defaults to 1.95
  popularityWeight?: number;  // Set the weight that popularity has for the each package score, defaults to 3.3
  maintenanceWeight?: number; // Set the weight that the quality has for the each package score, defaults to 2.05
}

type SearchResponse = {
  total: number;
  results: SearchResult[];
}

type SearchResult = {
  package: Package;
  score: Score;
  searchScore: number;
}

Suggestions

import { getSuggestions } from "npms-io-client";

getSuggestions("chal").then((results) => {
  console.log(results);
  // [
  //   {
  //     package: {
  //       name: 'chalk',
  //       scope: 'unscoped',
  //       version: '4.1.0',
  //       ...
  //     }
  //   },
  //   ...
  // ]
})

Types:

getSuggestions(query: string, size?: number) => Promise<SuggestionsResponse>;

Package

import { getPackage } from "npms-io-client";

getPackage("chalk").then((result) => {
  console.log(result);
  // {
  //   "analyzedAt": "2020-08-03T09:35:15.248Z",
  //   "collected": { "metadata": { ... }, "npm": { ... }, ... },
  //   "evaluation": { "quality": { ... }, "popularity": { ... }, ... }
  //   "score": { "final": 0.966624747619474, "detail": { "quality": 0.9545507877497884, "popularity": 0.9437035852952291, ... } }
  // }
});

Types:

getPackage(name: string) => Promise<PackageResult>;

type PackageResult = {
  analyzedAt: string;
  collected: PackageCollected;
  evaluation: PackageEvaluation;
  score: Score;
}

Packages

import { getPackages } from "npms-io-client";

getPackages(["chalk", "react"]).then((results) => {
  console.log(results);
  // {
  //   chalk: {
  //     analyzedAt: '2020-08-03T09:35:15.248Z',
  //     collected: {
  //       metadata: { ... },
  //       npm: { ... },
  //       github: { ... },
  //       source: { ... }
  //     },
  //     evaluation: { quality: { ... }, popularity: { ... }, maintenance: { ... } },
  //     score: { final: 0.966624747619474, detail: { ... } }
  //   },
  //   react: {
  //     analyzedAt: '2020-08-28T11:38:05.049Z',
  //     collected: {
  //       metadata: { ... },
  //       npm: { ... },
  //       github: { ... },
  //       source: { ... }
  //     },
  //     evaluation: { quality: { ... }, popularity: { ... }, maintenance: { ... } },
  //     score: { final: 0.9387208252920034, detail: { ... } }
  //   }
  // }
});

Types:

getPackages(packages: string[]): Promise<PackagesResponse>;

type PackagesResponse = PackageResult[];

MIT