CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-update-notifier

Update notifications for your CLI app

Overall
score

97%

Overview
Eval results
Files

task.mdevals/scenario-1/

Terminal Output Manager

A utility for managing terminal output in CLI applications that adapts behavior based on the execution environment.

Capabilities

Environment Detection

Detect whether the application is running in an interactive terminal environment or in a non-interactive context (such as piped output or redirected streams).

  • When running in an interactive terminal (TTY), the detector should return true @test
  • When output is piped to another command, the detector should return false @test
  • When output is redirected to a file, the detector should return false @test

Stream-Aware Output

Output messages to the appropriate stream based on message type and terminal environment.

  • Status messages should be written to stderr in TTY environments @test
  • Status messages should be suppressed when not in a TTY environment @test
  • The function should return true when a message was output, false when suppressed @test

Implementation

@generates

API

/**
 * Check if the application is running in an interactive terminal.
 *
 * @returns {boolean} true if running in a TTY, false otherwise
 */
export function isTTY();

/**
 * Write a status message to the appropriate output stream.
 * Only outputs in TTY environments. Messages are written to stderr.
 *
 * @param {string} message - The message to output
 * @returns {boolean} true if message was written, false if suppressed
 */
export function writeStatus(message);

Dependencies { .dependencies }

update-notifier { .dependency }

A package that demonstrates TTY detection and terminal output handling patterns for CLI applications. Study its approach to environment-aware output control.

@satisfied-by

Install with Tessl CLI

npx tessl i tessl/npm-update-notifier

tile.json