-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: node endpoint to check
isatty
and FORCE_TTY
automatically
- Loading branch information
1 parent
aae3a14
commit 42017d5
Showing
1 changed file
with
16 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,19 @@ | ||
import { isatty } from 'node:tty' | ||
import { createColors } from './index' | ||
import { | ||
createColors as originalCreateColors, | ||
isSupported as originalIsSupported, | ||
} from './index' | ||
|
||
export * from './index' | ||
export { Colors, Formatter, getDefaultColors } from './index' | ||
|
||
export default createColors(process.env.FORCE_TTY !== undefined || isatty(1)) | ||
const isTTY = process.env.FORCE_TTY !== undefined || isatty(1) | ||
|
||
export function isSupportted() { | ||
return originalIsSupported(isTTY) | ||
} | ||
|
||
export function createColors() { | ||
return originalCreateColors(isTTY) | ||
} | ||
|
||
export default originalCreateColors(isTTY) |