5 ms·
Show HN: A module to color console messages || NodeJs
- newsbinator 9y agoI use Chalk for this: https://github.com/chalk/chalk https://github.com/chalk/chalk
- talonbragg 9y agoI specifically made this to be more minimal and take up less space, as chalk actually has dependencies.
- imauld 9y agoWhy should I install what looks like a hundred or so Node modules to get something that supported natively by most terminals?
- wattengard 9y agoIf you want to deal with ANSI-codes be my guest. Libraries like this and Chalk are made for those of us that has better things to do than remember if ESC[0;32;41m is the correct ansi color code to show important information in.
- helb 9y agoIt's not "hundred or so Node modules", it's a single function that just prints out one of 6 ANSI codes: https://github.com/talonbragg/message-palette/blob/master/palette.js https://github.com/talonbragg/message-palette/blob/master/pa... It also eats the message silently when you try to use an "unsupported" color…
- danielrw7 9y agoYes, but the package.json's production dependencies [0] includes codecov [1] for CI which includes request [2] which includes another 22 dependencies. Moving that to the devDependencies should be fine since the main script doesn't require any modules. [0] https://github.com/talonbragg/message-palette/blob/master/package.json#L35 https://github.com/talonbragg/message-palette/blob/master/pa... [1] https://www.npmjs.com/package/codecov https://www.npmjs.com/package/codecov [2] https://www.npmjs.com/package/request https://www.npmjs.com/package/request
- imauld 9y agoThis is exactly what I mean. Looking at the repo there are a ton of packages in `node_modules` dir for a lib that should have 0 to a handful of dependencies. People will be more likely to use this lib if it's cleaned up a bit. I'm pretty new to using JS/npm and one of my least favorite parts of it this: npm install some-package 1400 packages installed So seeing packages that have a bunch of stuff in their node_modules gives me pause about using it, especially when it's not clear to me why it would need all those things.
- danielrw7 9y agoYeah, it's very easy for npm dependencies to get out of hand. What I didn't notice when I made my comment (and what you commented on) was that the node_modules dir was actually added to the git project. If that were removed (and a .gitignore line added) and the package.json dependencies were fixed then it should truly have no dependencies upon install.
- helb 9y agoYep, it's a bit uncommon to store node_modules in git these days (since we have npm shrinkwrap). I've sent a PR, and another one to stop the message disappearing with unsupported color. Also, the package author is 12 years old (http://talonbragg.com/ http://talonbragg.com/). I'd say this stuff is pretty impressive.
- maarky 9y agoLove your commit message style.
- kaushalmodi 9y ago"yeah boi" That's one good reason why I wouldn't even try this package.
- talonbragg 9y agoPLEASE READ: For all the people that complain about why or why not you want to use it, it won't change anything, the module is still gonna be here. So... please don't complain. The things I would like you to do if you don't see any use of this module are, first, just don't use it, second, don't complain, because other people are going to want to use it.
- talonbragg 9y agoJeez, this community is harsh, not even a little bit of constructive criticism.
- talonbragg 9y agoI think i'm just going to delete this repo.