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

@nswses/readiness

v1.0.2

Published

NSW SES units-of-competency domain logic and reports (Fit-For-Role and more)

Readme

@nswses/readiness

The domain engine behind Slipstream — an NSW SES unit tool for tracking members' training currency. This package turns an aXcelerate units-of-competency (UoC) export into capability findings and reports:

  • Parsing a UoC CSV export into typed rows.
  • Capability determination — deciding which capabilities each member holds from their achieved unit codes.
  • Fit for Role gap analysis — which Fit for Role assessments a member is missing.
  • Currency reports — First Aid and Code of Conduct expiry/currency.
  • Reminders planning — which members have an item expiring within a threshold.

It has no database or UI. It takes data in and returns plain values, so the same logic runs in the web app, the CLI, and a scheduled email job without disagreeing.

Install

npm install @nswses/readiness

Built and tested on Node 24 (the version this repo pins). Published from CI with a provenance attestation via npm trusted publishing (no long-lived tokens) — see docs/readiness-publishing.md.

Usage

Parse an export and print the Fit for Role gap report:

import { readFileSync } from "node:fs";
import { parseCsv, Snapshot } from "@nswses/readiness";

const rows = parseCsv(readFileSync("units-of-competency.csv", "utf8"));
const snapshot = new Snapshot({ attainedUnitsOfCompetency: rows });

console.log(snapshot.report());          // text Fit for Role gap report
snapshot.capabilitiesByMember();         // Map<memberId, Set<Capability>>
snapshot.gapsByCapability();             // missing Fit for Role assessments, per capability

Build a specific report as data (the web app renders these):

import { parseCsv, reportBySlug } from "@nswses/readiness";

const rows = parseCsv(csvText);
const firstAid = reportBySlug("first-aid");   // slug: "ffr" | "first-aid" | "code-of-conduct"
const table = firstAid?.compute(rows);         // MemberReportRow[] — per-member status rows

What's in the public API

Everything is re-exported from the package root (import { ... } from "@nswses/readiness"). The main pieces:

| Area | Exports | |---|---| | Parsing | parseCsv, normalizeHeader, parseDdmmyyyy, formatYmd | | Snapshot | Snapshot, unitsOfCompetency, ffrFor | | Capabilities | capabilitiesFor, grantingCodesFor, capabilities, Capability | | Reports | ffrReport, reports, reportBySlug, firstAidReport, codeOfConductReport | | Currency | classifyCurrency, Currency, SOON_DAYS | | Fit for Role views | ffrMemberDetails, CAPABILITY_COLUMNS, CAPABILITY_LABELS | | Reminders | planReminders, reminderItems, REMINDER_THRESHOLDS | | Units | unitsFor, resolveUnits, UNITS | | Members | memberSummary, resolveMemberEmail, isMemberEmail |

Configuration, not code

Two things that change with SES policy live as validated JSON, so changing them is a data edit, not a code change:

  • src/capabilities.json — each capability's label, the unit codes that determine it, prerequisites, and its Fit for Role assessment block.
  • src/units.json — the registry of real NSW SES unit names, used to attribute members to units and to recover space-joined location values from the export.

Both are checked by tests (capabilities.config.test.ts, units.config.test.ts).

Dates and time zones

This package is deliberately time-zone-free. It works in date-only calendar values (parseDdmmyyyy + formatYmd, a symmetric local-midnight round-trip). Currency classification takes an injected today, so the calling app decides the wall-clock (Slipstream passes Sydney time). Don't add time-zone handling here.

Development

npm test --workspace packages/readiness   # Jest + ts-jest, pure logic, no DB
npm run build --workspace packages/readiness

Tests use inline fixtures and never real member data.

License

MIT