Skip to content

Conversation

@jorgebucaran
Copy link

Hi @adamreisnz!

This PR swaps chalk for turbocolor. Same API and usage + 10x~20x faster load time and runtime and no deps! Let me know if this looks good to you and if you'd like to take my contribution :)

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

Cheers!


Note: I also noted you depend on yargs, but are using none of its fancy options, so I could send you another PR to replace it with getopts, a much much lighter and faster CLI parser.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 1ebd0e1 on jorgebucaran:master into 0f6a4bc on adamreisnz:master.

2 similar comments
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 1ebd0e1 on jorgebucaran:master into 0f6a4bc on adamreisnz:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 1ebd0e1 on jorgebucaran:master into 0f6a4bc on adamreisnz:master.

Copy link
Owner

@adamreisnz adamreisnz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @jorgebucaran, thanks for the PR. I see you developed turbocolor yourself, but it hasn't been in use for very long yet.

As this package is now relied on by many other packages and developers, I'm hesitant to switch to packages that haven't been time-tested yet. Same goes for getopts. The performance gains look impressive, but there might be a trade-off in terms of cross-system compatibility or other things that only show up after hundreds of thousands of downloads on different machines.

I'll have to pass this up for now, but will keep an eye out on your packages and see how they progress. Good luck with your promotion :)

"dependencies": {
"chalk": "^2.3.2",
"glob": "^7.1.2",
"turbocolor": "2.3.0",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a particular reason for having this fixed on version 2.3.0?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adamreisnz Typo. I forgot to type in a ^. I can fix that.

@jorgebucaran
Copy link
Author

jorgebucaran commented Jul 18, 2018

@adamreisnz No problem! FWIW I've been developing turbocolor and getopts since ca. 2015 and tested them well over the years. Both packages also have 100% coverage now, but you are right to always be cautious, especially since neither chalk or minimist is broken in any way.

Thank you, for taking it into consideration. Cheers! :)

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.

3 participants