@isel-jao/ts-lib
v0.1.4
Published
A collection of small, general-purpose TypeScript utilities for everyday application code.
Readme
@isel-jao/ts-lib
A collection of small, general-purpose TypeScript utilities for everyday application code.
Features
- Zero dependencies — nothing gets pulled into your bundle but this library itself.
- Tree-shakeable — ships as ES modules with no side effects, so bundlers only include the parts you actually import.
- Type-safe — written in TypeScript with full type definitions included.
- Works in both ESM and CommonJS projects.
Installation
npm install @isel-jao/ts-libUsage
Import only what you need — unused exports are automatically excluded from your final bundle.
import { /* ... */ } from "@isel-jao/ts-lib";Modules
Every module ships its own reference doc covering why it exists, how it works internally, its full API, and its edge cases.
| Module | What it does | Main exports |
| --- | --- | --- |
| columnar | Converts arrays of records to and from column-oriented form. | toColumnarByFirstKeys, toColumnarByAllKeys, fromColumnar |
| console-styles | ANSI escape codes and an emoji set for styling terminal output. | Ansi, Emoji |
| create-function | Builds sync and async functions from source strings at runtime. | createSyncFunction, createAsyncFunction |
| ensure-unique-name | Suffixes a name until it stops colliding with names already taken. | ensureUniqueName |
| evaluate-template | Resolves {{ ... }} expressions against a context and parses the document into a typed value. | evaluateTemplate, serialize, TEMPLATE_RE |
| http-error | Typed error classes for the common 4xx/5xx statuses, with a JSON-serializable shape. | HttpError, NotFoundError, createHttpError |
| registry | A named-value store that fails fast on duplicate registration. | Registry |
| reverse-dependencies | Inverts a dependency graph to answer "what depends on this?". | reverseDependencies |
| ring-buffer | Fixed-capacity circular buffer with O(1) insertion and removal at both ends. | RingBuffer |
| topo-sort | Topological sort with cycle detection. | topoSort |
| utility-types | Derives the authored (pre-evaluateTemplate) shape of a config from its resolved shape. | Templated, TemplatedRecord |
