recolors
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

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'

Package Sidebar

Install

npm i recolors

Weekly Downloads

11

Version

1.0.0

License

ISC

Unpacked Size

8.17 kB

Total Files

6

Last publish

Collaborators

  • lucacicada