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

@ckreidl/katana-client

v1.2.1

Published

TypeScript client for the Katana MRP API

Readme

katana-client

TypeScript client for the Katana MRP REST API.

Install

npm install @ckreidl/katana-client

Usage

import { KatanaClient } from "@ckreidl/katana-client";

// Both options are optional — apiKey falls back to KATANA_API_KEY env var,
// and requestsPerSecond defaults to 1 (or KATANA_REQUESTS_PER_SECOND env var).
const client = new KatanaClient({
  apiKey: "your-api-key",
  requestsPerSecond: 5,
});

// List products
const products = await client.products.list({ name: "Widget" });

// Get a single product
const product = await client.products.get({ id: 1 });

// Create a product
const created = await client.products.create({ name: "Widget", uom: "pcs" });

// Update a product
const updated = await client.products.update({ id: 1, name: "Updated Widget" });

// Paginate through all results
for await (const page of client.paginate(client.products.list, {})) {
  console.log(page);
}

Typed extend Parameter

Several Katana endpoints accept an extend query parameter that includes related resources in the response. This client provides overloaded method signatures so TypeScript narrows the return type when you specify extend:

// Without extend — supplier is optional, requires null checks
const product = await client.products.get({ id: 1 });
product.supplier?.name; // string | undefined

// With extend — supplier is guaranteed present
const extended = await client.products.get({ id: 1, extend: ["supplier"] });
extended.supplier.name; // string | undefined (field exists, but name is optional)

Supported extend values by resource:

| Resource | Extend Value | Field Added | | ---------------- | --------------------- | --------------------- | | Products | supplier | supplier | | Materials | supplier | supplier | | Variants | product_or_material | product_or_material | | Inventory | variant, location | variant, location | | Sales Order Rows | variant | variant | | Purchase Orders | supplier | supplier |

Note: These response fields are not documented in the Katana OpenAPI spec. See SPEC_GAPS.md for details.

Configuration

| Option | Environment Variable | Description | Default | | ------------------- | ---------------------------- | ------------------------- | ------- | | apiKey | KATANA_API_KEY | API bearer token | — | | requestsPerSecond | KATANA_REQUESTS_PER_SECOND | Rate limit (requests/sec) | 1 |

Constructor options take precedence over environment variables.

License

MIT