1.0.0 • Published 2 years ago

recolors v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

recolors

picocolors alternative as a module!

import { green, italic } from 'recolors'

console.log(
  green(`How are ${italic(`you`)} doing?`)
)

Or alternatively:

import * as nc from 'recolors'

console.log(
  nc.green(`How are ${nc.italic(`you`)} doing?`)
)

There are no default exports!

Why

When embedding picocolors, you say goodbye to the tree shaking, this library is designed to be embedded instead, unused colors are removed from the final bundle.

Difference with picocolors

  • ES Module instead of CommonJS
  • Better typings!
  • picocolors.isColorSupported is COLORS_SUPPORTED
import { COLORS_SUPPORTED } from 'recolors'
  • There are no default exports! You need to use import { red } from 'recolors' or import * as nc from 'recolors'