Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stevenvachon/supports-semigraphics
Determine if a terminal/stream supports text animations.
https://github.com/stevenvachon/supports-semigraphics
animation ansimation cli console nodejs terminal
Last synced: 25 days ago
JSON representation
Determine if a terminal/stream supports text animations.
- Host: GitHub
- URL: https://github.com/stevenvachon/supports-semigraphics
- Owner: stevenvachon
- License: mit
- Created: 2017-05-25T01:59:34.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-05-23T12:18:12.000Z (over 4 years ago)
- Last Synced: 2024-10-06T04:23:01.026Z (about 2 months ago)
- Topics: animation, ansimation, cli, console, nodejs, terminal
- Language: JavaScript
- Homepage:
- Size: 15.6 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# supports-semigraphics [![NPM Version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Monitor][greenkeeper-image]][greenkeeper-url]
> Determine if a terminal/stream supports text animations.
Some environments try to simulate a TTY which can bugger up logs with your progress bar, character spinner, etc [semigraphic animations](https://en.wikipedia.org/wiki/Semigraphics).
## Installation
[Node.js](http://nodejs.org) `>= 4` is required. To install, type this at the command line:
```shell
npm install supports-semigraphics
```## Usage
```js
const supportsSemigraphics = require('supports-semigraphics');if (supportsSemigraphics()) {
// the terminal probably has support for semigraphics
}
```You can also check a specific stream:
```js
supportsSemigraphics(fs.createWriteStream('./output.log'));
//-> false
```## Forcing Support
The use of `--animation` or `--no-animation` CLI flags in any command will be obeyed. Additionally, so will the environment variable `FORCE_ANIMATION`.
[npm-image]: https://img.shields.io/npm/v/supports-semigraphics.svg
[npm-url]: https://npmjs.com/package/supports-semigraphics
[travis-image]: https://img.shields.io/travis/stevenvachon/supports-semigraphics.svg
[travis-url]: https://travis-ci.org/stevenvachon/supports-semigraphics
[greenkeeper-image]: https://badges.greenkeeper.io/stevenvachon/supports-semigraphics.svg
[greenkeeper-url]: https://greenkeeper.io/