Skip to content

upgrade: swap chalk→turbocolor; remove extraneous devDep#1878

Merged
ricardograca merged 1 commit into
bookshelf:masterfrom
jorgebucaran:master
Jul 18, 2018
Merged

upgrade: swap chalk→turbocolor; remove extraneous devDep#1878
ricardograca merged 1 commit into
bookshelf:masterfrom
jorgebucaran:master

Conversation

@jorgebucaran

Copy link
Copy Markdown
Contributor

Hi! @ricardograca! 👋

Summary

This PR replaces chalk for turbocolor. Turbocolor is a ligther/faster drop-in replacement for chalk (10x~20x faster load time & runtime) with no dependencies. This is not a breaking change.

Motivation

Improve one dependency for a more performant one and remove an extraneous dependency.

Proposed solution

Turbocolor has essentially the same API as chalk; it's just lighter (no deps) and faster. See full benchmarks.

turbocolor/chalk
# Load Time
chalk: 15.190ms
turbocolor: 0.777ms

# All Colors
chalk × 8,729 ops/sec
turbocolor × 158,383 ops/sec

# Chained Colors
chalk × 1,838 ops/sec
turbocolor × 39,830 ops/sec

# Nested Colors
chalk × 4,049 ops/sec
turbocolor × 59,833 ops/sec

Current PR Issues

None.


Let me know if this looks good to you and if you'd like to accept my contribution :)

@ricardograca

Copy link
Copy Markdown
Member

Hey @jorgebucaran thanks for the contribution. It looks good to me. I was actually thinking of removing chalk altogether since it's only used to output a single color in a single place, so not sure how useful it is, but I'll accept this for now, especially because it has no dependencies.

@ricardograca ricardograca merged commit 2afb78e into bookshelf:master Jul 18, 2018
@jorgebucaran

Copy link
Copy Markdown
Contributor Author

Thanks, @ricardogama! If you need help with that or if you want to use it in more places I'd love to help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants