package
Sets `process.std(in/out/err).isTTY` to true basing on env vars.
npm install forceable-ttyGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Sets process.std(in/out/err).isTTY to true basing on env vars.
Include require('forcable-tty').override();
in your code.
Then you can use FORCE_STDIN_TTY=1, FORCE_STDOUT_TTY=1 or FORCE_STDIN_TTY=1 env variable to get required outcome.
[~/forceable-tty] echo test | ./example/example.js
process.stdin.isTTY: undefined
process.stdout.isTTY: true
process.stderr.isTTY: true
[~/forceable-tty] echo test | FORCE_STDIN_TTY=1 ./example/example.js
process.stdin.isTTY: true
process.stdout.isTTY: true
process.stderr.isTTY: trueThis project is licensed under the terms of the MIT license.
This piece of code was authored by @brian-mann and @bahmutov and published in cypress under MIT license. As it solves an issue I had with testing on some CI that uses windows, I've republished it as small separate package I could use in my code. Big thanks to them!.
Estimated unpacked size across 2 packages.
53.6 kB
Includes dependencies.