2.0.14 • Published 2 years ago

isansi v2.0.14

Weekly downloads
15
License
MIT
Repository
github
Last release
2 years ago

isansi

isansi checks whether a string uses ANSI color and style.

Status

CategoryStatus
Versionnpm
DependenciesDavid
Dev dependenciesDavid
BuildGitHub Actions
LicenseGitHub

Installation

$ npm install isansi

Quick start

First you need to add a reference to isansi in your application:

const { isAnsi } = require('isansi');

If you use TypeScript, use the following code instead:

import { isAnsi } from 'isAnsi';

To check a string for a specific color or style, use the appropriate function of the isAnsi object:

const text = chalk.green.bold('foo');

console.log(isAnsi.green(text));  // => true
console.log(isAnsi.bold(text));   // => true

console.log(isAnsi.red(text));    // => false
console.log(isAnsi.italic(text)); // => false

The module supports all colors and styles that are supported by chalk.

Running quality assurance

To run quality assurance for this module use roboter:

$ npx roboter
2.0.14

2 years ago

2.0.13

3 years ago

2.0.12

3 years ago

2.0.11

3 years ago

2.0.9

3 years ago

2.0.10

3 years ago

2.0.8

3 years ago

2.0.7

3 years ago

2.0.6

3 years ago

2.0.5

3 years ago

2.0.4

3 years ago

2.0.3

4 years ago

2.0.2

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.0.2

9 years ago