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

@albertomarturelo/sii-core

v0.6.0

Published

Shared SII domain core: rut, config (prod hostnames), contracts, tasks, seams. A Node library; external side-effects (portal, secrets, audit, clock) are injected via seams (ADR-003).

Readme

@albertomarturelo/sii-core

The shared SII (Servicio de Impuestos Internos, Chile) domain core — the engine behind the sii CLI and the sii-mcp server. A Node library: every legal and operational guardrail (throttling, audit, credential handling, the operate-centric identity model) lives here, so a consumer that codes against the task layer gets the same rails the first-party surfaces do.

Open source (MIT). See ADR-018 and ADR-019. Published to the public npm registry. (Earlier 0.x releases were private on GitHub Packages under the @altumstack scope — ADR-015; superseded.)

Install

pnpm add @albertomarturelo/sii-core
# or: npm install @albertomarturelo/sii-core

zod comes along as a dependency. playwright is an OPTIONAL peer (ADR-016): only the default PortalDriver (the @albertomarturelo/sii-core/node subpath) needs it. If you use that default driver — i.e. you actually drive a real browser against SII — install it plus the Chromium binary once:

pnpm add playwright
pnpm exec playwright install chromium

If you inject your own PortalDriver (or only use the tasks/primitives), skip this entirely — nothing in the main barrel imports playwright or node:*.

Usage

A consumer builds a Runtime (the composition root that wires the Node default adapters, from the ./node subpath) and calls tasks — the public operations. Never reach past the task layer into a sub-module; that bypasses the guardrails (ADR-003).

import { authStatus, rcvSummary } from '@albertomarturelo/sii-core';
import { createNodeRuntime } from '@albertomarturelo/sii-core/node';

const runtime = createNodeRuntime();

// Who is the current session operating as? (pure-local read)
const status = await authStatus(runtime);

// Read the RCV compra summary for a period (body-RUT surface — `rut` optional).
const resumen = await rcvSummary(runtime, { periodo: '2026-05', side: 'compra' });
console.log(JSON.stringify(resumen, null, 2));

Tasks return plain JSON-serializable objects (no Date/Map/Set) — that is the library contract (ADR-012). Authentication is an explicit verb: tasks consume a live session or raise NotAuthenticated; only login mints one. Logging in opens a real browser where the user types their Clave (cookies-only; the password never crosses the library boundary — ADR-006).

Injecting your own seams

The external side-effects are interfaces (PortalDriver, KeyValueStore, AuditSink, Clock, …). createNodeRuntime accepts a Partial<Runtime> of overrides, so partial reuse is a supported path — e.g. Node defaults with your own audit sink and portal driver (an embedding app's mediated browser):

import { createNodeRuntime } from '@albertomarturelo/sii-core/node';

const runtime = createNodeRuntime({ audit: myAuditSink, portal: myPortalDriver });

In-memory fakes ship under testing so a consumer's tests never touch the real SII, keyring, or clock — assemble a Runtime from them:

import { testing, type Runtime } from '@albertomarturelo/sii-core';

const runtime: Runtime = {
  clock: new testing.FixedClock(new Date('2026-06-29T12:00:00Z')),
  audit: new testing.RecordingAuditSink(),
  store: new testing.InMemoryKeyValueStore(),
  portal: new testing.FakePortalDriver({ requestPublic: () => '<html>…</html>' }),
};

What's inside

  • auth / identity — single-account, operate-centric session model (ADR-005).
  • read surfacesrcv, f22, f29, bte, dte (authorized, public).
  • primitivesRut (Mod-11), Periodo / Anio, prod HOSTS, audit.

See docs/ARCHITECTURE.md and docs/ROADMAP.md for the full picture, and CHANGELOG.md for release notes.

Releasing (maintainers)

Bump version in package.json, then push a matching v* tag — the publish-core GitHub Action builds and publishes to GitHub Packages on tag (ADR-015):

# after bumping version to e.g. 0.2.0 and merging to main
git tag v0.2.0
git push origin v0.2.0