supports-semigraphics

1.0.1 • Public • Published

supports-semigraphics NPM Version Build Status Dependency Monitor

Determine if your terminal supports text animations.

Some environments try to simulate a TTY which can bugger up logs with your progress bar, character spinner, etc semigraphic animations.

Installation

Node.js >= 4 is required. To install, type this at the command line:

npm install supports-semigraphics

Usage

const supportsSemigraphics = require('supports-semigraphics');
 
if (supportsSemigraphics()) {
    // the terminal probably has support for semigraphics
}

You can also check a specific stream:

supportsSemigraphics(fs.createWriteStream('./output.log'));
//-> false

Info

It obeys the --animation and --no-animation CLI flags.

For situations where using --animation is not possible, add an environment variable FORCE_ANIMATION with any value to force animations. Trumps --no-animation.

Package Sidebar

Install

npm i supports-semigraphics

Weekly Downloads

9

Version

1.0.1

License

MIT

Last publish

Collaborators

  • stevenvachon