diff --git a/bench/colors.js b/bench/colors.js index 552f030..25638a2 100755 --- a/bench/colors.js +++ b/bench/colors.js @@ -1,5 +1,6 @@ const chalk = require('chalk'); const ansi = require('ansi-colors'); +const colorette = require('colorette'); const { Suite } = require('benchmark'); const colors = require('../colors'); const kleur = require('../index'); @@ -24,6 +25,9 @@ bench('All Colors') .add('chalk', () => { names.forEach(name => chalk[name]('foo')); }) + .add('colorette', () => { + names.forEach(name => colorette[name]('foo')); + }) .add('kleur', () => { names.forEach(name => kleur[name]('foo')); }) @@ -40,6 +44,9 @@ bench('Stacked colors') .add('chalk', () => { names.forEach(name => chalk[name].bold.underline.italic('foo')); }) + .add('colorette', () => { + names.forEach(name => colorette[name](colorette.bold(colorette.underline(colorette.italic('foo'))))); + }) .add('kleur', () => { names.forEach(name => kleur[name]().bold().underline().italic('foo')); }) @@ -52,6 +59,7 @@ bench('Stacked colors') bench('Nested colors') .add('ansi-colors', () => fixture(ansi)) .add('chalk', () => fixture(chalk)) + .add('colorette', () => fixture(colorette)) .add('kleur', () => fixture(kleur)) .add('kleur/colors', () => fixture(colors)) .run(); diff --git a/bench/load.js b/bench/load.js index e0889bb..838588d 100755 --- a/bench/load.js +++ b/bench/load.js @@ -13,3 +13,7 @@ console.timeEnd('kleur/colors'); console.time('ansi-colors'); const color = require('ansi-colors'); console.timeEnd('ansi-colors'); + +console.time('colorette'); +const colorette = require('colorette'); +console.timeEnd('colorette'); diff --git a/bench/package.json b/bench/package.json index f90a85a..283ae6f 100755 --- a/bench/package.json +++ b/bench/package.json @@ -3,6 +3,7 @@ "devDependencies": { "ansi-colors": "4.1.1", "benchmark": "2.1.4", - "chalk": "4.0.0" + "chalk": "4.1.0", + "colorette": "1.2.1" } }