Skip to content

import {getColorDepth} from 'tty' #40236

Closed
@arcanis

Description

@arcanis

Is your feature request related to a problem? Please describe.
The getColorDepth and hasColors functions are currently attached to the tty.WriteStream prototype, even though they seem fairly standalone (their result depends on the env, not the stream). As a result, accessing them "legally" (without extracting them from the prototype) isn't possible when process.stdout & co aren't proper ttys.

Describe the solution you'd like
It would be useful to be able to just import getColorDepth & friends from tty.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestIssues that request new features to be added to Node.js.stalettyIssues and PRs related to the tty subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions