-
Notifications
You must be signed in to change notification settings - Fork 54
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
[epic] npm logging, output, and cleaning #810
Comments
Putting some notes here for future improvements that this will now unlock:
|
Customizable colors
Our goal is to have one (1) good and accessible color palette for all output shown to the terminal. BUT if we find cases where that is impossible (eg dark vs light terminal backgrounds) it is now at least possible to have a config option to change colors. |
Command templatesWhat if a command could do this? // producer
const data = { name, version }
output.standard(data, {
templates: {
// pick any templating DSL
human: `{{ name }}@{{ version }}`,
parseable: `{{ name }}\t{{ version }}`
}
})
// consumer
process.on('output', (level, data, { templates }) => {
if (level === 'standard') {
const templateName = templates[this.human ? 'human' : this.parseable : 'parseable' : '']
process.stdout.write(template(data, templateName || JSON.stringify))
}
}) |
Closing this out. This epic is considered done. There are follow up tasks that we will put back into the planning queue. This will all go out w/ the next npm release. |
Epic
We are going to consolidate and clean up the code npm uses for output, logging, and for sanitizing strings before doing those things.
Currently these are the modules used:
This is likely not a comprehensive list, and not everything here belongs in our new consolidated package for npm output concerns.
Tasks
time
andinput
proc-log#80proc-log
for stdout and stderr cli#7373Notes
npm progress bars will go away for now
This replaces the following issues
stderr
&stdout
#546The text was updated successfully, but these errors were encountered: