Skip to content

v2.0.0

Compare
Choose a tag to compare
@webdiscus webdiscus released this 03 Nov 11:53
· 41 commits to master since this release

Features

  • Added support for Deno.
  • Added support for Next.js edge runtime.
  • Added NEW named import for ansis:
    import { red } from 'ansis';
    For example:
    NEW v2.x.x
    import ansis, { red } from 'ansis'; // default and named import
    ansis.red`error`;
    red`error`;
    OLD 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, use ansi256() or alias fg() instead.
  • The barely used bgAnsi() function name is deprecated, use bgAnsi256() or alias bg() instead.