TypeScript

npm install agent-first-data
import { jsonResult, render } from "agent-first-data";

const event = jsonResult({
  api_key_secret: "sk-123",
  latency_ms: 1280,
  db_url: "postgres://user:p@ss@db/app?token_secret=abc",
}).build();

console.log(render(event.toJSON(), "json"));
console.log(render(event.toJSON(), "plain"));

Useful names use TypeScript casing: render, outputOptionsForPolicy, redactedValue, redactUrlSecrets, redactUrlsInText, redactArgv, normalizeUtcOffset, isValidRfc3339Date, isValidRfc3339Time, isValidRfc3339, isValidBcp47, decodeProtocolEvent, cliParseOutput, cliParseLogFilters, buildCliError, and buildCliVersion.

Behavior Notes

Reference