Skip to content

@briklab/lib

@briklab/lib is a TypeScript-first utility collection for runtime validation, warnings, styling helpers, color utilities, and CLI tooling.

Good First Steps

Read module introductions first, then jump to class/type pages from the left sidebar.

Install

bash
npm i @briklab/lib

Modules

  • jstc: Runtime type checking (JSTypeChecker, JSTC).
  • warner: Structured warning collection and reporting.
  • stylesheet: InlineStyle and StyleSheet helpers.
  • color: Color parsing/formatting and ANSI output.
  • cli-john: Node.js CLI framework.

Quick Start

ts
import { Warner } from "@briklab/lib/warner";
import { JSTC } from "@briklab/lib/jstc";

const warner = new Warner({ level: "summary", packageName: "my-package" });
warner.warn({ message: "Deprecated option used", hint: "Use --strict instead." });
warner.finalize();

JSTC.setProtectionLevel("boundary");
const ok = JSTC.for([42]).check(["number"]);
console.log(ok); // true

Diagram

100%Ctrl + wheel to zoom