summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorDaniel Khodabakhsh <d@niel.khodabakh.sh>2025-06-24 16:18:58 -0700
committerAndreas Enge <andreas@enge.fr>2026-01-27 10:39:45 +0100
commitf868a147096c28c3c0e9aa2c7a38ffdd4ddaefdf (patch)
tree64e12f6f5447b62606734c26182e395c8409e813 /gnu
parentd44c3fc267f4009673ed9960c3e38524545defb3 (diff)
gnu: Add node-supports-color.
* gnu/packages/node-xyz.scm (node-supports-color): New variable. Change-Id: I00d7701662e4d3752426aca5aece879fa8d15c79 Signed-off-by: Andreas Enge <andreas@enge.fr>
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/node-xyz.scm34
1 files changed, 34 insertions, 0 deletions
diff --git a/gnu/packages/node-xyz.scm b/gnu/packages/node-xyz.scm
index ef9f8085ad..fa3564ae95 100644
--- a/gnu/packages/node-xyz.scm
+++ b/gnu/packages/node-xyz.scm
@@ -2291,6 +2291,40 @@ sequences.")
(home-page (git-reference-url (origin-uri source)))
(license license:expat)))
+(define-public node-supports-color
+ (package
+ (name "node-supports-color")
+ (version "5.5.0")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/chalk/supports-color")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "1wfwzxjh4q7wv8p8wjrhlcdljdydjpcydgdysy9y161xy6r99db9"))))
+ (build-system node-build-system)
+ (inputs (list
+ node-has-flag))
+ (arguments (list
+ #:tests? #f ; FIXME: Tests require 'xo' and 'ava'.
+ #:phases #~(modify-phases %standard-phases
+ (add-before 'patch-dependencies 'modify-package (lambda _
+ (modify-json
+ (delete-dev-dependencies)))))))
+ (synopsis "Detect whether a terminal supports color")
+ (description "Returns an Object with a stdout and stderr property for testing either\
+ streams. Each property is an Object, or false if color is not supported.
+
+The stdout/stderr objects specifies a level of support for color through a .level\
+ property and a corresponding flag:
+
+ * .level = 1 and .hasBasic = true: Basic color support (16 colors)
+ * .level = 2 and .has256 = true: 256 color support
+ * .level = 3 and .has16m = true: Truecolor support (16 million colors)")
+ (home-page (git-reference-url (origin-uri source)))
+ (license license:expat)))
+
(define-public node-tiddlywiki
(package
(name "node-tiddlywiki")