1.0.1 • Published 8 years ago
supports-semigraphics v1.0.1
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-semigraphicsUsage
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'));
//-> falseInfo
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.