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

@washy-washy/core

v1.5.6

Published

Chart parsing, mixing rules and machine validation for washy-washy — a laundry chart generator.

Downloads

8,296

Readme

@washy-washy/core

check npm Codecov license docs

Chart parsing, machine validation, and mixing rules for washy-washy, a laundry chart generator. This package holds no rendering or file I/O — just the pure logic a CSV/JSON chart is checked and reasoned about with, shared by the CLI, the web app, and @washy-washy/pdf.

Jump to: Browser · Node and Bun (CSV) · What's in it · Development · API reference

Requirements

  • Node.js 18+, Bun, or any other runtime with modern ESM/exports map support.
  • No system packages, no external services, no credentials — this package does no file I/O and no network access.

Install

npm install @washy-washy/core

Two entry points

| Import | Use when | Includes | | --------------------------- | --------------------------------- | --------------------------------- | | @washy-washy/core/browser | Bundled for a browser | Everything except CSV parsing | | @washy-washy/core | Node/Bun, reading a CSV from disk | Everything, including CSV parsing |

@washy-washy/core's CSV parser depends on csv-parse, which reaches for Node's Buffer at import time even if nothing calls it — a bundler ships that reference into the client, and it dies at runtime with Buffer is not defined. @washy-washy/core/browser excludes it: a browser consumer reads and writes charts as JSON instead (chartFromJson/ chartToJson), which needs no such dependency.

Usage

Browser

Read and write a chart as JSON instead of CSV — @washy-washy/core/browser has no CSV parser (see Two entry points).

import {
  chartFromJson,
  chartToJson,
  parseMachine,
} from "@washy-washy/core/browser";

const machine = parseMachine(machineConfig);
const instructions = chartFromJson(jsonFromStorage, machine);

Node and Bun (CSV)

import { parseInstructions, parseMachine } from "@washy-washy/core";

const machine = parseMachine(JSON.parse(machineFileContents));
const instructions = parseInstructions(csvFileContents, machine);

What's in it

  • Every chart row carries an optional referenceName/referenceLink pair — who to credit for a care instruction that isn't obvious from the garment itself ("the manufacturer says wash these alone"), and a link backing it up. Both are empty strings when there's nothing to cite.
  • parseMachine validates a machine description (washer programmes, temperatures, spins, options; iron thermostat positions) and hands back a typed Machine. Every failure names the field that's wrong.
  • parseInstructions (CSV) and chartFromJson/chartToJson (JSON) parse a chart against a Machine, rejecting any row that asks for a setting the machine doesn't have. duration is checked too, against ~H:MM (the ~ is optional) — empty is still fine, for a pile with no duration on record.
  • parseConfig/configFromJson/configToJson do the same for a machine and a chart together, as one { machine, chart } object — the chart is always validated against the machine it's embedded with. configToJson's output leads with a $schema key (schema/config.schema.json, generated from the Config type, so it can't drift) — an editor that reads it, VS Code among them, validates and autocompletes the file with no setup. The output is plain JSON.stringify(..., null, 2) — if you write it straight to a file in a Biome- or Prettier-linted repo, run your own formatter over it afterward, since a generic serializer can't match either tool's opinions.
  • mixBlocker/canMix/resolve decide whether two piles of laundry can share a drum, and why not when they can't.
  • cardGroups/washGroups/ironGroups group instructions the way a printed chart is laid out: one card per identical setup, a wash-only cut, an iron-only cut ordered by thermostat position.

Every exported function and type carries a TSDoc comment with a runnable example — that's your editor's hover, and it's also the generated API reference. @washy-washy/pdf has the same.

Development

bun install
bun run check    # lint, typecheck, test
bun run build    # emit dist/ (tsdown)

See CONTRIBUTING.md and, for how the modules fit together, docs/ARCHITECTURE.md.

License

GPL-3.0-or-later.