guix_mirror_bot pushed a commit to branch master
in repository guix.

commit f868a147096c28c3c0e9aa2c7a38ffdd4ddaefdf
Author: Daniel Khodabakhsh <[email protected]>
AuthorDate: Tue Jun 24 16:18:58 2025 -0700

    gnu: Add node-supports-color.
    
    * gnu/packages/node-xyz.scm (node-supports-color): New variable.
    
    Change-Id: I00d7701662e4d3752426aca5aece879fa8d15c79
    Signed-off-by: Andreas Enge <[email protected]>
---
 gnu/packages/node-xyz.scm | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

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")

Reply via email to