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

@openschedule/za-customs

v0.1.3

Published

Local-cache TypeScript API for South African SARS customs schedule lookup, source trace, and mechanical duty estimates.

Readme

@openschedule/za-customs

South African customs duty lookups and estimates for TypeScript apps.

@openschedule/za-customs downloads official SARS customs schedule PDFs into your cache, builds indexed local cache artifacts, and lets your app look up tariff lines, rates, duty estimates, source references, duties, trade remedies, rebates, drawbacks, and refunds.

npm install @openschedule/za-customs
import { createZaCustoms } from "@openschedule/za-customs";

const customs = await createZaCustoms({ sync: "if-stale" });
const line = customs.lookup("000110", { includeMetadata: true });
const estimate = customs.estimate({
  tariffCode: "000110",
  customsValue: 1000,
  effectiveDate: "2026-07-05"
});

To enumerate current Schedule 1 tariff lines from an existing cache without syncing:

const customs = await createZaCustoms({ cacheDir, sync: "never" });

for (let cursor: string | undefined; ;) {
  const page = customs.tariffLines({ includeMetadata: true, limit: 500, cursor });
  for (const line of page.items) {
    console.log(line.normalizedTariffCode, line.displayName);
  }
  if (!page.nextCursor) break;
  cursor = page.nextCursor;
}

Sync modes are never, if-missing, if-stale, and always. Production apps should normally use if-stale in their own environment.

Live SARS parser smoke tests are opt-in and use local PDF paths, for example:

OPENSCHEDULE_SARS_PDF_PATH=/path/to/schedule-1-part-1.pdf npm test

Other env-gated parser tests follow the same OPENSCHEDULE_SARS_*_PDF_PATH pattern and are skipped when unset.

Why it works this way:

  • Runs locally after sync: once the managed cache exists, lookups and estimates do not need internet access or a hosted tariff API.
  • Easy to audit: includeMetadata: true and source() show parser warnings, SARS PDF page references, and document hashes.
  • Typed for app developers: TypeScript types and JSON schemas describe tariff lines, rates, estimates, source references, and validation results.
  • Tested without copying SARS data: npm test includes 50 synthetic duty examples covering ad valorem, specific, compound, preferential/free, and unresolved fallback cases.
  • Flags incomplete parses: validation warns when a parse produced too few lines, reported parser warnings, or has mismatched counts.
flowchart LR
  sars["Official SARS schedule PDFs"] --> sync["Your app downloads supported sources"]
  sync --> cache["Your local cache<br/>PDFs + download metadata"]
  cache --> build["OpenSchedule builds<br/>indexed cache artifacts"]
  build --> runtime["Your app reads<br/>the local cache"]
  runtime --> output["Lookup and estimate results"]
  runtime --> audit["Optional audit details<br/>PDF page + SHA-256 + warnings"]

  cache -. "OpenSchedule does not publish SARS PDFs or datasets" .-> build
  runtime -. "No hosted API needed after sync" .-> output
  audit -. "Check result against SARS source" .-> output

OpenSchedule does not ship SARS PDFs, SARS datasets, or a prebuilt customs database. Examples use synthetic tariff codes to avoid copying official SARS tariff content.

OpenSchedule is not a customs broker, classification engine, legal opinion, or hosted tariff API. Verify legal reliance against official SARS sources.