JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 774
  • Score
    100M100P100Q111233F
  • License MIT

Node.js adapter for bijou — chalk styling, readline I/O, process runtime.

Package Exports

  • @flyingrobots/bijou-node
  • @flyingrobots/bijou-node/package.json

Readme

@flyingrobots/bijou-node

Node.js adapter for bijou — chalk styling, readline I/O, process runtime.

What's New in 0.2.0?

  • onResize() supportnodeIO() now listens to process.stdout resize events, enabling terminal resize detection in TUI apps

See the CHANGELOG for the full release history.

Install

npm install @flyingrobots/bijou @flyingrobots/bijou-node

Usage

import { initDefaultContext } from '@flyingrobots/bijou-node';
import { box, headerBox } from '@flyingrobots/bijou';

// Wire up Node.js adapters and set the default context.
// Auto-detects TTY, CI, NO_COLOR, and TERM=dumb.
initDefaultContext();

console.log(headerBox('My CLI', { detail: 'v1.0.0' }));

What It Provides

bijou-node implements the three ports that @flyingrobots/bijou requires:

Port Implementation What it does
RuntimePort nodeRuntime() process.env, TTY detection, terminal dimensions
IOPort nodeIO() process.stdout/stdin, readline, resize events
StylePort chalkStyle() RGB/hex color via chalk, respects NO_COLOR

API

// Individual port factories
import { nodeRuntime, nodeIO, chalkStyle } from '@flyingrobots/bijou-node';

// All-in-one context (most common)
import { createNodeContext, initDefaultContext } from '@flyingrobots/bijou-node';

// createNodeContext() — returns a BijouContext without setting it as default
const ctx = createNodeContext();

// initDefaultContext() — creates context AND registers it as the global default
initDefaultContext();

See ARCHITECTURE.md for how the adapter maps to Node.js APIs, and GUIDE.md for usage patterns.

License

MIT