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

politician

v1.0.3

Published

A bureaucratic test framework with the gravitas of 1980s government documentation. Designed for tests that are as easy to write as they are beautiful to read.

Readme

POLITICIAN TEST FRAMEWORK

═══════════════════════════════════════════════════════════════════════════════
POLITICIAN TEST FRAMEWORK v1.0
Classification: UNCLASSIFIED
Document Control Number: PTF-1984-001
Effective Date: 1984-01-01
═══════════════════════════════════════════════════════════════════════════════

A bureaucratic test framework with the gravitas of 1980s government documentation. Designed for tests that are as easy to write as they are beautiful to read.

Features

  • Bureaucratic Aesthetic: 1980s IBM/NASA/NSA-inspired documentation style
  • Configurable Verbosity: From silent to debug, control your output
  • Beautiful Markdown: Print-ready reports with proper formatting
  • Chainable API: Write tests in a fluent, readable style
  • Low Indirection: Simple, straightforward test authoring

Quick Start

import { createTestSuite, VERBOSITY_LEVELS } from './assert.js';

const suite = createTestSuite('My Test Suite', {
  verbosity: VERBOSITY_LEVELS.VERBOSE,
  classification: 'UNCLASSIFIED',
  documentId: 'TEST-001'
});

suite
  .header()
  .section('UNIT TESTS')
  .test('Basic arithmetic works', () => 2 + 2 === 4)
  .test('String comparison works', () => ({
    passed: 'hello' === 'hello',
    actual: 'hello',
    expected: 'hello'
  }))
  .exit();

Verbosity Levels

VERBOSITY_LEVELS = {
  SILENT: 0,      // No output
  QUIET: 1,       // Errors only
  NORMAL: 2,      // Errors and test results (no success messages)
  VERBOSE: 3,     // All output including successes (default)
  DEBUG: 4        // Everything including debug info
}

API Reference

Document Structure

  • .header() - Display document header with classification and metadata
  • .section(title) - Create a numbered section
  • .subsection(title) - Create a numbered subsection

Code Display

  • .code(language, content, label) - Display code block with optional label
  • .javascript(content, label) - Display JavaScript code (shorthand)

Testing

  • .test(description, assertion) - Run a test
  • .assertEqual(actual, expected, description) - Assert equality
  • .assertArraysEqual(actual, expected, description) - Assert array equality

Output

  • .log(...args) - Log at VERBOSE level
  • .info(...args) - Info message at NORMAL level
  • .warn(...args) - Warning at NORMAL level
  • .error(...args) - Error at QUIET level
  • .success(...args) - Success message at VERBOSE level

Completion

  • .summary() - Display test summary
  • .exit() - Display summary and exit with appropriate code

Example: Full Test Suite

#!/usr/bin/env node
import { createTestSuite, VERBOSITY_LEVELS } from './assert.js';
import { transform } from '../index.js';

const suite = createTestSuite('Transformation Compliance', {
  verbosity: VERBOSITY_LEVELS.VERBOSE,
  classification: 'UNCLASSIFIED',
  documentId: 'TC-2025-001'
});

const input = 'class A {}';
const output = transform(input);

suite
  .header()
  .section('PRELIMINARY DOCUMENTATION')
  .javascript(input, 'INPUT: Source Code')
  .javascript(output, 'OUTPUT: Transformed Code')

  .section('COMPLIANCE VERIFICATION')
  .test('Transformation succeeds', () => output !== null)
  .test('Output is valid', () => ({
    passed: output.includes('class'),
    actual: output,
    expected: 'Code containing class declaration'
  }))

  .exit();

Design Philosophy

"If it's worth testing, it's worth documenting with bureaucratic precision."

The Politician Test Framework treats every test as an official government document, complete with:

  • Document control numbers
  • Classification markings
  • Formal section numbering
  • Professional formatting
  • Audit-ready output

Tests should be:

  1. Easy to write - Minimal boilerplate, chainable API
  2. Beautiful to read - Print-ready markdown formatting
  3. Professional - Government-grade documentation standards
  4. Informative - Clear reporting at every verbosity level

═══════════════════════════════════════════════════════════════════════════════
END OF DOCUMENT
═══════════════════════════════════════════════════════════════════════════════