Skip to content

Terminal colors built-in to Node #42770

@Exortions

Description

@Exortions

What is the problem this feature will solve?

Having to download external libraries like chalk, colors, etc.
This also aids the scenario where programmers are without package managers. Sometimes, one standalone file in JavaScript is best. Implementing this feature would aid those individuals, and also reduce the bundle size because no package managers would have to be used for a simple JavaScript program.

Using Yarn or NPM makes a node_modules folder, which is especially large by only adding one dependency just for terminal colors.

Hopefully, you take this issue into consideration, and I would be happy to help implement a such feature.

What is the feature you are proposing to solve the problem?

An enumeration of ANSI escape codes for users to easily access to change the color of the terminal.

Example usage of this would be:

console.log(`${Colors.PURPLE}${Colors.ITALIC}This is italicized purple text`

What alternatives have you considered?

One alternative (already exists) would be to use a package manager like Yarn or NPM to download a package like 'chalk' or 'colors'.
However, Node.JS users not using package managers would be unable to accomplish this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestIssues that request new features to be added to Node.js.stale

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions