supports-semigraphics
v1.0.1
Published
Determine if your terminal supports text animations.
Downloads
10
Maintainers
Readme
supports-semigraphics
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
.