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

api-automation-library

v1.0.0

Published

Reusable API library for automation testing. It calls an API and checks the answer.

Downloads

149

Readme

api-automation-library

Reusable API library for automation testing. It calls an API and checks the answer.

An API is a hidden helper. You ask it a question. It sends an answer. This library asks, then checks the answer.

Real example

Ask: who is user 1?

https://jsonplaceholder.typicode.com/users/1

A good answer says:

  • the reply worked (status 200)
  • the id is 1
  • the name is Leanne Graham
import { auditApi } from "api-automation-library";

const report = await auditApi({
  request: { url: "https://jsonplaceholder.typicode.com/users/1" },
  expect: {
    status: [200],
    maxResponseTimeMs: 5000,
    jsonPath: [
      { path: "id", equals: 1 },
      { path: "name", equals: "Leanne Graham" },
    ],
  },
});

console.log(report.passed);

If every check is good, report.passed is true. If the name is wrong, or no answer comes, report.passed is false.

Install

npm install api-automation-library

Node.js 18 or newer.

Checks

| Check | Meaning | |---|---| | status | The answer code is one you allow. 200 means yes. | | responseTime | The answer came within the time you allow. | | headers | The answer has the labels you asked for. | | schema | The answer has the right fields and types. | | jsonPath | One fact is exactly right, such as the name. | | bodyContains | The answer text contains the words you expect. |

Pass report: { dir: "api-report" } to also save report.json and report.html.

Try it in this repo

npm install
npm test
npm run example

npm run example calls the real user API and prints pass or fail.