Skip to content

@briklab/lib

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

Getting Started

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

Install

Follow the common installation tutorial

Modules

  • jstc: Runtime type checking with JSTypeChecker and JSTC singleton
  • warner: Structured warning collection and reporting
  • stylesheet: CSS-in-JS with InlineStyle and StyleSheet helpers
  • color: Color parsing, formatting, and ANSI terminal output
  • cli-john: Node.js CLI framework with command routing

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

Live Demo

Recommended to test it in your browser. The test here might not work properly
Console
No logs yet.