Skip to content
This repository has been archived by the owner on Nov 22, 2021. It is now read-only.

Colorette Changes

Andrey Sitnik edited this page Oct 2, 2021 · 12 revisions

This project was started as fork of colorette 2.0.2 because of API changes in 2.x branch.

To respect origin project we mention the author and project in the first line of README.md. Nano Colors repository contains colorette’s commits. See number of fork’s commits.

API Changes

  1. Colors support detection for top-level color functions (colorette later does the same).
  2. Color functions was rewritten for better performance (colorette later back-ported this optimization).
    colorette 2.0.2  19,712,884 ops/sec
    nanocolors       47,256,069 ops/sec
    
  3. Project loading was changed for better import performance.
    colorette 2.0.2  1.034 ms
    nanocolors       0.486 ms
    
  4. Color support detections added --color and --no-color arguments support for chalk compatibility (colorette later does the same).
  5. Type safety fixes for disabled colors.
  6. *Bright colors was removed for smaller package size. They have inconsistent support and rarely used.
  7. Universal browser/Node.js project support.
  8. createColors API changes.

Maintaining Changes

  1. Test project for old Node.js versions to be able to replace chalk in big projects.
  2. Tests for compatibility between ESM and CJS versions and various tests for color support detection.
  3. Build scripts was replaced to manually created ESM/CJS dual package for smaller package size.
  4. Project is promoting as a replacement for chalk. In contrast, colorette does not promote itself as a chalk replacement.
Clone this wiki locally