Releases: webdiscus/ansis
Releases · webdiscus/ansis
v3.3.1
v3.3.0
Chore
- Deleted
old
named import syntax 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');
- Cleanup
pickages.json
for NPM - Updated
README
for NPM
v3.2.1
v3.2.0
Features
- Added
ansis.isSupported()
method to detect color support.
v3.1.1
Cumulative Release v3.0.1
- v3.1.1
Features
- Added detection of color support when using PM2 process manager.
Bug Fixes
- Correct 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.
Chore
- Reduce unpacked size from 49 KB to 14 KB.
v3.0.0
Features
- Added detection of color spaces support: TrueColor, 256 colors, 16 colors, no color (black & white).
- Added fallback for supported color space: truecolor —> 256 colors —> 16 colors —> no colors.
- Improved performance for the
hex()
function.
BREAKING CHANGE
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.
Support Node.js
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.
Deleted styles
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
Deleted methods
The methods are deleted:
ansi
, replace in your code withansi256
orfg
bgAnsi
, replace in your code withbgAnsi256
orbg
Deleted clamp in functions
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
v2.3.0
Cumulative Release v2.0.1
- v2.3.0
Features
- Added detection of additional terminals, thanks @dse, colors.js:issue #42.
- Added supports the argument as
number
. - Added
bgGrey
andbgGray
aliases forbgBlackBright
.
Bug Fixes
- Fixed index.d.ts to use function overload to make the tagged template have the correct type, #16.
- Fixed when could not be found a declaration file for module 'ansis'.
v2.0.0
Features
- Added support for Deno.
- Added support for Next.js
edge
runtime. - Added NEW named import for
ansis
:For example:import { red } from 'ansis';
NEWv2.x.x
OLDimport ansis, { red } from 'ansis'; // default and named import ansis.red`error`; red`error`;
v1.5.x
import ansis from 'ansis'; // default import import { red } from 'ansis/colors'; // named import ansis.red`error`; red`error`;
- Optimised named export into one file to avoid separate wraps files for CJS and ESM.
- Reduced the size of
dist/
directory by 50%.
BREAKING CHANGE (TypeScript only)
The deprecated OLD named import from 'ansis/colors'
still works, but using TypeScript can be occurred the error:
TS2307: Cannot find module ansis/colors ...
Solution: update your code, e.g.: import { red } from 'ansis/colors'
--> import { red } from 'ansis'
DEPRECATIONS
- OLD named import
import { red } from 'ansis/colors'
is deprecated, use the NEW named import. - The barely used
ansi()
function name is deprecated, useansi256()
or aliasfg()
instead. - The barely used
bgAnsi()
function name is deprecated, usebgAnsi256()
or aliasbg()
instead.
v1.5.5
Cumulative Release v1.3.0
- v1.5.5
Features
- Added support for nested template literal syntax:
console.log(red`red ${yellow`yellow ${green`green`} yellow`} red`)
- Added named export of colors with support for chained syntax:
import { red, green, yellow } from 'ansis/colors'; console.log(red.bold.underline`text`);
- Added extending of base colors with named custom truecolor:
import ansis from 'ansis'; ansis.extend({ orange: '#FFAB40' }); console.log(ansis.orange.bold('text'));
- Added the
strip()
method to remove all ANSI codes from string - Added UK spelling alias
grey
forgray
- Added support for both CommonJS and ESM
- Added aliases:
.fg()
for.ansi256()
and.bg()
for.bgAnsi256()
methods - Optimized distributed code size to less than
4 KB
.
Bug Fixes
- Fixed
visible
style with nested template strings - Set correct aliases for
bgAnsi
andfg
methods by named export - Regard the value of the environment variable
FORCE_COLOR=0
to force disable colors
v1.2.2
Cumulative Release v1.1.0
- v1.2.2
Features
- Added supports the environment variables
NO_COLOR FORCE_COLOR
and flags--no-color
--color
- Added aliases
.ansi()
for.ansi256()
and.bgAnsi()
for.bgAnsi256()
methods - Added support for the use of
open
andclose
properties for each style - Improve performance
Bug Fixes
- Fixed ANSI codes for
ansi256()
andbgAnsi256()
methods