# @mtth/stl-utils

> Standard utilities

Latest version **0.9.7** (published 2026-02-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install @mtth/stl-utils
pnpm add @mtth/stl-utils
yarn add @mtth/stl-utils
bun add @mtth/stl-utils
```

## Health

**Score 50/100 (C)** — status: stable.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.9.7 |
| Published | 2026-02-20 |
| First published | 2025-02-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Dependencies | 7 |
| Unpacked size | 88.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Matthieu Monsch |
| Maintainers | mtth |
| Keywords | stl |

## Links

- npm: https://www.npmjs.com/package/@mtth/stl-utils
- Repository: https://forge.mtth.dev/mtth/sdk.ts
- npm.io page: https://npm.io/package/@mtth/stl-utils

## Dependencies (7)

- [picomatch](https://npm.io/package/picomatch.md) ^4.0.3
- [change-case](https://npm.io/package/change-case.md) ^5.4.4
- [fast-deep-equal](https://npm.io/package/fast-deep-equal.md) ^3.1.3
- [untruncate-json](https://npm.io/package/untruncate-json.md) ^0.0.1
- [@mtth/stl-errors](https://npm.io/package/@mtth/stl-errors.md) 0.9.7
- [temporal-polyfill](https://npm.io/package/temporal-polyfill.md) ^0.3.0
- [@mtth/inlinable-runtime](https://npm.io/package/@mtth/inlinable-runtime.md) 0.9.7

## Recent versions

- 0.9.7 (latest) — 2026-02-20
- 0.8.2 — 2025-04-25
- 0.8.1 — 2025-04-25
- 0.8.0 — 2025-04-24
- 0.7.1 — 2025-03-29
- 0.7.0 — 2025-03-15
- 0.6.0 — 2025-02-15
- 0.5.0 — 2025-02-15
- 0.4.2 — 2025-02-15
- 0.4.1 — 2025-02-15
- 0.4.0 — 2025-02-15

## README

# @mtth/stl-utils

Infrastructure-friendly utilities: typed event emitters, bindable server
lifecycles, pretty printers, environment helpers, and more.

## Quickstart

```sh
pnpm add @mtth/stl-utils
```

```ts
import {typedEmitter} from '@mtth/stl-utils/events';
import {PrettyFormatter} from '@mtth/stl-utils/objects';

interface WorkerEvents {
  ready(): void;
  failed(err: unknown): void;
}

const events = typedEmitter<WorkerEvents>();
events.on('ready', () => console.log('ready for traffic'));
events.emit('ready');

const pretty = PrettyFormatter.create();
console.log(pretty.format({token: Buffer.alloc(256)}));
```

## Highlights

- Type-safe emitters via `typedEmitter`, `withEmitter`, and `withTypedEmitter`
  keep Node-style event code honest without third-party wrappers.
- `Bindable`, `Host`, and `serverHost` standardize how long-running services
  bind, emit lifecycle events, and react to signals.
- Formatting helpers (PrettyFormatter, relative indexable views, truncation)
  keep structured logs readable even with large payloads or buffers.
- A grab bag of ergonomic primitives (environment inspection, strings,
  collections, opaque nominal types) removes incidental plumbing from
  higher-level packages.

---
_Source: https://npm.io/package/@mtth/stl-utils · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
