Provides a small Node.js utility to determine the stdout window width for CLI apps. It tries multiple fallbacks, including TTY, `output.columns`, a `CLI_WIDTH` environment variable, and then a configurable default, returning a width value useful for formatting terminal output.
Project status
- The repo shows an upstream push timestamp of 2026-01-21, but the most recently summarized versioned updates are from 2016 (v2.1.0, v2.0.0, v1.1.1), so it is unclear from the provided evidence whether there have been ongoing, user-facing updates since then.
- Apparent update cadence, based on the version history shown, is sporadic and clustered around early 2016 (v1.1.1 on 2016-01-26, v2.0.0 on 2016-02-08, v2.1.0 on 2016-02-15), with no further versioned updates listed afterward.
AI summary generated Today
Recent updates
v2.1.0
2/15/2016This release adds a new fallback to determine stdout width. The implementation now checks for an output stream width via `output.columns` in addition to the existing tty and `CLI_WIDTH` environment variable fallbacks.
BreakingFeaturesv2.0.0
2/8/2016This release changes how cli-width is configured, moving from a property-based default to an options object. The exported function now accepts configuration (default width, output stream, and tty module) while keeping the same general fallback order (stdout, tty, then environment/default).
BreakingFeaturesv1.1.1
1/26/2016This release updates the width-detection fallback logic so that when terminal width detection reports 0, the library falls back to the configurable defaultWidth. It also updates project tooling for test coverage reporting and ignores tests in the published npm package.
v1.1.0
10/16/2015Version v1.1.0 introduces support for overriding the computed CLI width via an environment variable. The runtime logic and accompanying tests were updated, and the README now documents a new fallback before the default width.
Featuresv1.0.0
1/22/2015This release is the initial launch of version v1.0.0. No release notes were provided, so there is no documented information about new features, fixes, or changes.
v1.0.1
1/22/2015This release (v1.0.1) adds a fix for the defaultWidth behavior and introduces automated tests. It also updates package tooling to run the new test suite and updates the README accordingly. No publisher release notes were provided, so the changes below are derived purely from the code diff.
Features