open-index/open-npm huggingface dataset:
npm package: @mtth/stl-telemetry
Description: Standard telemetry library
Author: Matthieu Monsch
Latest version: 0.9.7

# @mtth/stl-telemetry

Structured logging, metrics, and tracing primitives with first-class TypeScript
support and OpenTelemetry integration.

## Quickstart

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

```ts
import {RecordingTelemetry, instrumentsFor} from '@mtth/stl-telemetry';

const telemetry = RecordingTelemetry.forTesting({name: 'payments-service'});

const [metrics] = telemetry.metrics(
  instrumentsFor({
    requests: {
      name: 'payments.requests',
      kind: 'counter',
      unit: '{requests}',
      labels: {result: 'result'},
    },
  })
);

telemetry.logger.info('service ready');
metrics.requests.add(1, {result: 'ok'});

telemetry.withActiveSpan({name: 'charge-card'}, (span) => {
  span.addEvent('calling gateway');
  // ...do the work...
  span.end();
});
```

## Highlights

- A single `Telemetry` interface powers loggers, spans, and metrics; `.via()`
  automatically scopes library metadata.
- Type-safe metrics with `instrumentsFor()` generate strongly typed
  recorders and guard against typo-prone label names.
- Logger providers support dynamic thresholding, structured values, and
  recording destinations for tests.
- Helpers like `withActiveSpan`, `recordErrorOnSpan`, and `settingLogLevel`
  keep OpenTelemetry plumbing consistent across services and libraries.
npm package: @mtth/stl-utils
Description: Standard utilities
Author: Matthieu Monsch
Latest version: 0.9.7

# @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.
npm package: @mtth/tsconfig
Description: Shared TypeScript config
Author: Matthieu Monsch
Latest version: 0.9.7

# TypeScript configuration

Shared `tsconfig.json`, inspired by https://github.com/tsconfig/bases.

## Quickstart

```sh
$ npm i @mtth/tsconfig
```

Then, inside `tsconfig.json`:

```json
{
 "extends": "@mtth/tsconfig"
}
```