forked from orbit-oss/chalk
ES2015ify the codebase
This commit is contained in:
parent
cb3f2308e1
commit
249b9ac7e7
7 changed files with 223 additions and 237 deletions
14
benchmark.js
14
benchmark.js
|
|
@ -1,24 +1,24 @@
|
|||
/* globals set bench */
|
||||
'use strict';
|
||||
var chalk = require('./');
|
||||
const chalk = require('.');
|
||||
|
||||
suite('chalk', function () {
|
||||
suite('chalk', () => {
|
||||
set('iterations', 100000);
|
||||
|
||||
bench('single style', function () {
|
||||
bench('single style', () => {
|
||||
chalk.red('the fox jumps over the lazy dog');
|
||||
});
|
||||
|
||||
bench('several styles', function () {
|
||||
bench('several styles', () => {
|
||||
chalk.blue.bgRed.bold('the fox jumps over the lazy dog');
|
||||
});
|
||||
|
||||
var cached = chalk.blue.bgRed.bold;
|
||||
bench('cached styles', function () {
|
||||
const cached = chalk.blue.bgRed.bold;
|
||||
bench('cached styles', () => {
|
||||
cached('the fox jumps over the lazy dog');
|
||||
});
|
||||
|
||||
bench('nested styles', function () {
|
||||
bench('nested styles', () => {
|
||||
chalk.red('the fox jumps', chalk.underline.bgBlue('over the lazy dog') + '!');
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue