Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add flag to force color output #31

Open
adius opened this issue Sep 2, 2017 · 5 comments
Open

Add flag to force color output #31

adius opened this issue Sep 2, 2017 · 5 comments

Comments

@adius
Copy link

adius commented Sep 2, 2017

I run the code on AWS Lambda and save it to a file.
Chalk.js, however, thinks it doesn't support colors and prints no escape codes.
I had to monkey patch the code

var chalk = require('chalk')
var chalk = new chalk.constructor({enabled: true, level: 3})
var Table = require('cli-table')

to make it work

@adius
Copy link
Author

adius commented Sep 2, 2017

This is a better solution:

process.env.FORCE_COLOR = 1
const MarkedTerminal = require('marked-terminal')

Attention: Must be set before requiring marked-terminal

@adius
Copy link
Author

adius commented Sep 2, 2017

Being able to set it as a MarkedTerminal setting would yet still be better ;-)

@mikaelbr
Copy link
Owner

Hm. I think maybe the best way here is to have a option to marked terminal with the chalk instance. I think this is a good first contribute for someone, as it would be fairly small scoped and doesn't require any big job of formatting text and regexery etc.

@millette
Copy link
Contributor

You might also want to support the emerging NO_COLOR standard.

@mikaelbr
Copy link
Owner

Thanks @millette. Think that could be it's own issue so it can be followed up better.

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

No branches or pull requests

3 participants