Blyp Docs

Utilities & Runtime

Runtime detection

import { runtime, createRuntimeAdapter, createLogDir } from "blyp-js";

console.log(runtime.type);   // "bun" or "node"
console.log(runtime.isBun);  // boolean
console.log(runtime.isNode); // boolean

runtime exposes a RuntimeAdapter with:

  • file.existsSync
  • file.mkdirSync
  • file.writeFileSync
  • path.join
  • env.get
  • cwd()

Color helpers

import {
  getMethodColor,
  getStatusColor,
  getArrowForMethod,
  getResponseTimeColor,
  getColoredLevel,
  colors,
} from "blyp-js";

These helpers power Blyp's pretty console output and are useful in custom CLIs or reporting tools.

Config helpers

import {
  DEFAULT_CONFIG,
  DEFAULT_CLIENT_LOGGING_CONFIG,
  DEFAULT_FILE_CONFIG,
  DEFAULT_ROTATION_CONFIG,
  getConfig,
  loadConfig,
  mergeBlypConfig,
  resolveConfig,
  resetConfigCache,
} from "blyp-js";

Use them when you want to inspect defaults, merge overrides manually, or reset config state in tests.

On this page

No Headings