- fix: correct detect TTY on Windows platform
- chore: optimize code to reduce the size by ~50 bytes
- chore: add benchmarks for
kolorist
package - test: add test matrix for windows on GitHub
- docs: add compare the size of most popular packages
- chore: optimize code to reduce the size by ~600 bytes,
- chore: minify
index.d.ts
to reduce the size by ~200 bytes, - chore: increase performance, e.g. using chained styles, 70.000.000 -> 80.000.000 ops/sec
- feat(BREAKING CHANGE): remove
old
named import DEPRECATED inv2.0.0
(2023-11-03). If you update the package fromv1.x
tov3.3.0
then check your code:
ESMCJS- import { red } from 'ansis/colors'; + import { red } from 'ansis';
- const { red } = require('ansis/colors'); + const { red } = require('ansis');
- chore: cleanup/optimize
package.json
for npm package
- chore: reduce unpacked size by ~ 1 KB
- docs: optimize README for NPM
- feat: add
ansis.isSupported()
method to detect color support
- fix: interpret FORCE_COLOR=false or FORCE_COLOR=0 as force disable colors
others values, e.g., FORCE_COLOR=true or FORCE_COLOR=1 - force enable colors.
See https://force-color.org.
- feat: add detection of color support when using PM2 process manager
- chore: add rollup-plugin-cleanup to remove comments from d.ts file for dist, that save yet 3 KB
- chore: update license year
- chore: create mini version of README for NPM to minify package size
- docs: update readme
- refactor: improve code
- chore: reduce code bundle size from 3.8 KB to 3.4 KB
- chore: update benchmark
- chore: update compare tests
- test: add more tests
- docs: improve readme
- feat: add detection of color spaces support: TrueColor, 256 colors, 16 colors, no color
- feat: add fallback for supported color space: truecolor —> 256 colors —> 16 colors —> no colors
- perform: improve performance for
hex()
function - chore: size increased from 3.2 KB to 3.8 KB as new features were added
- test: switch from jest to vitest
- test: add tests for new features
- docs: update readme for color spaces support
In the new major version 3.x
are removed unused styles and methods.
⚠️ WarningBefore update, please check your code whether is used deleted styles and methods.
Drop supports for Node <= 14
. Minimal supported version is 15.0.0
(Released 2020-10-20).
In the theory the v3
can works with Node12
, but we can't test it.
ESM
- import { red } from 'ansis/colors';
+ import { red } from 'ansis';
CJS
- const { red } = require('ansis/colors');
+ const { red } = require('ansis');
The not widely supported
styles are deleted:
faint
(alias for dim), replace in your code withdim
doubleUnderline
, replace in your code withunderline
frame
, replace in your code withunderline
encircle
, replace in your code withunderline
overline
, replace in your code withunderline
The methods are deleted:
ansi
, replace in your code withansi256
orfg
bgAnsi
, replace in your code withbgAnsi256
orbg
The clamp (0, 255) for the ANSI 256 codes and RGB values is removed, because is unused. You should self check the function arguments.
The affected functions:
ansi256
andfg
(alias to ansi256) - expected a code in the range0 - 255
bgAnsi256
andbg
(alias to bgAnsi256) - expected a code in the range0 - 255
rgb
- expected r, g, b values in the range0 - 255
bgRgb
- expected r, g, b values in the range0 - 255
- feat: add detection of additional terminals, thanks @dse, colors.js:issue #42
- test: add test to detect various terminals
- feat: add supports the argument as
number
- test: add tests for new feature
- chore: add features compare of different libs, just run:
npm run compare
- chore: add compare example on stackblitz
- docs: update readme
- feat: add
bgGrey
andbgGray
aliases forbgBlackBright
- refactor: optimize source code
- test: refactor tests
- docs: update readme
- fix(index.d.ts): use function overload to make the tagged template have the correct type, #16
- fix: could not find a declaration file for module 'ansis'
- fix: missing exports of ansis.strip() and ansis.export() functions (issue was introduced in v2.0.0)
- refactor: optimize code to reduce distributed size
- test: add test for generated npm package in CJS and ESM mode
- test: add test for env variables and CLI flags
- test: add test to detect Deno
- test: add test to detect Next.js runtime
- docs: update readme
- feat: add supports the Deno
- feat: add supports the Next.js
edge
runtime - feat(CHANGE): add named import for
ansis
:
NEW named import:import { red } from 'ansis'
.
If you useTypeScript
and your IDE show the error:TS2307: Cannot find module ansis/colors
,
then you should use the new syntax, update you code:import { red } from 'ansis/colors'
-->import { red } from 'ansis'
. - feat(DEPRECATE): OLD named import
import { red } from 'ansis/colors'
is deprecated, use the NEW named import - feat(DEPRECATE): instead of the
ansi
useansi256
or aliasfg
- feat(DEPRECATE): instead of the
bgAnsi
usebgAnsi256
or aliasbg
- feat: optimize named export
- feat: reduce the size of dist/ directory
- chore: update dev dependencies, new jest requires node.js >= 14
- feat: add supports the Deno
- feat: add supports the Next.js
edge
runtime - test: add tests for isSupported() function
- chore: update dev dependencies
- chore: update dev dependencies
- chore: add SECURITY.md
- chore: add PULL_REQUEST_TEMPLATE.md
- chore: update ISSUE_TEMPLATE
- docs: update readme
- refactor: optimize code to reduce size by 120 bytes
- test: add test for isSupported() function
- docs: update readme, add example screenshots
- fix: visible style with nested template strings
- fix: set correct aliases for bgAnsi and fg methods by named export
- chore: refactor examples
- docs: update readme
- fix: regard the value of the environment variable FORCE_COLOR=0 to force disable colors
- test: add tests for FORCE_COLOR
- docs: update readme
- fix: add missing export for CJS mode in package.json
- test: add manual tests for CJS and ESM mode
- DEPRECATE v1.5.0, because missing exports main for CJS mode, fixed in v1.5.1
- feat: add supports the nested template literal syntax:
console.log(red`red ${yellow`yellow ${green`green`} yellow`} red`)
- feat: add named export of colors with supports for chained syntax:
import { red, green, yellow } from 'ansis/colors'; console.log(red.bold.underline`text`);
- feat: add extending of base colors with named custom truecolor
import ansis from 'ansis'; ansis.extend({ orange: '#FFAB40' }); console.log(ansis.orange.bold('text'));
- fix: corrected declarations in
index.d.ts
- chore: add
AnsiStyles
,AnsiColors
and AnsiColorsExtend types inindex.d.ts
- refactor: optimize size of distributed bundle from 3.7KB to 3.1KB
- docs: add usage in CLI
- feat: add method strip() to remove all ANSI codes from string
- build: properly generated distribution package, bump to last stable version 1.3.6
- chore: update dev packages
- DEPRECATED: this version is broken
- feat: optimize distributed code size to smaller than
4 KB
- feat: add UK spelling alias
grey
forgray
- chore: update dev dependencies
- docs: update readme
- feat: add bundle generation for ESM
- build: auto generate bundles for ESM and CommonJS at npm publish
- fix: usage for CommonJS:
const ansis = require('ansis').default;
-->const ansis = require('ansis');
- feat: add support CommonJS (now supported ESM and CommonJS)
- feat: add aliases:
.fg()
for.ansi256()
and.bg()
for.bgAnsi256()
methods - fix: some inner param types
- chore: remove examples from NPM package (it can be cloned und run local)
- fix: the path of examples in package.json
- chore: add demo examples of all features
- docs: update readme
- feat: add supports the environment variables
NO_COLOR
FORCE_COLOR
and flags--no-color
--color
- feat: add aliases
ansi
foransi256
andbgAnsi
forbgAnsi256
- docs: add to readme the compare of most popular ANSI libraries
- feat: add the class Ansis to create more independent instances to increase the performance by benchmark
- feat: improve performance
- refactor: code refactoring
- docs: update readme
- feat: add supports the use of
open
andclose
properties for each style - fix: codes for methods ansi256() and bgAnsi256()
- chore: added demo to npm package
- chore: update package.json
- docs: update readme
First release