;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2020 Efraim Flashner ;;; Copyright © 2020 Giacomo Leidi ;;; Copyright © 2021 Noisytoot ;;; Copyright © 2021 Charles ;;; Copyright © 2021 Philip McGrath ;;; Copyright © 2021 Dhruvin Gandhi ;;; Copyright © 2022 Nicolas Graves ;;; Copyright © 2023 Jelle Licht ;;; Copyright © 2024-2026 Daniel Khodabakhsh ;;; ;;; This file is part of GNU Guix. ;;; ;;; GNU Guix is free software; you can redistribute it and/or modify it ;;; under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 3 of the License, or (at ;;; your option) any later version. ;;; ;;; GNU Guix is distributed in the hope that it will be useful, but ;;; WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with GNU Guix. If not, see . (define-module (gnu packages node-xyz) #:use-module (gnu packages base) ; sed #:use-module (gnu packages sqlite) #:use-module (gnu packages python) #:use-module (gnu packages web) ; node-esbuild #:use-module (guix build-system node) #:use-module (guix gexp) #:use-module (guix git-download) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages)) ;;; ;;; Please: Try to add new module packages in alphabetic order. ;;; (define-public node-acorn (package (name "node-acorn") (version "8.7.1") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/acornjs/acorn") (commit version))) (file-name (git-file-name name version)) (sha256 (base32 "10lpqbq4wvndx13mh7yjqgpcp3ac81b9zmrn4qb1qpzgy462fa92")))) (build-system node-build-system) (arguments '(#:tests? #f #:modules ((guix build node-build-system) (srfi srfi-1) (ice-9 match) (guix build utils)) #:phases (modify-phases %standard-phases (add-after 'unpack 'change-directory (lambda _ (chdir "acorn"))) (add-before 'configure 'avoid-prepare-scripts (lambda _ ;; We need to remove the prepare script from "package.json", as ;; it would try to use the build environment and would block the ;; automatic building by other packages making use of node-acorn. (modify-json (delete-fields '(("scripts" "prepare")))))) (replace 'build (lambda* (#:key inputs native-inputs #:allow-other-keys) (let ((esbuild (search-input-file (or native-inputs inputs) "/bin/esbuild"))) (invoke esbuild "src/index.js" "--outfile=dist/acorn.js" "--format=cjs" "--bundle" "--platform=node") (invoke esbuild "src/index.js" "--outfile=dist/acorn.mjs" "--format=esm" "--bundle" "--platform=node") (invoke esbuild "src/bin/acorn.js" "--outfile=dist/bin.js" "--format=cjs" "--platform=node"))))))) (native-inputs (list esbuild)) (home-page "https://github.com/acornjs/acorn/tree/master/acorn") (synopsis "Javascript-based Javascript parser") (description "Acornjs is a Javascript parser with many options and an architecture supporting plugins.") (license license:expat))) (define-public node-addon-api (package (name "node-addon-api") (version "8.3.0") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/nodejs/node-addon-api") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "1swvhdss2w636l24bnssnwb1rqh7i6lhpkk4knbrvpspqf80kagc")))) (inputs (list python node-safe-buffer)) (build-system node-build-system) (arguments `(#:modules ((guix build node-build-system) (srfi srfi-1) (ice-9 match) (guix build utils)) #:phases (modify-phases %standard-phases (add-after 'patch-dependencies 'delete-dependencies (lambda args (modify-json (delete-dependencies `("benchmark" "bindings" "clang-format" "eslint" "eslint-config-semistandard" "eslint-config-standard" "eslint-plugin-import" "eslint-plugin-node" "eslint-plugin-promise" "fs-extra" "neostandard" "path" "pre-commit" "semver")) ;; We can't run the js-based tests, ;; but we can still do the C++ parts (replace-fields (list (cons "scripts.test" "echo stopping after pretest on Guix"))))))))) (home-page "https://github.com/nodejs/node-addon-api") (synopsis "Node.js API (Node-API) header-only C++ wrappers") (description "This module contains header-only C++ wrapper classes which simplify the use of the C based Node-API provided by Node.js when using C++. It provides a C++ object model and exception handling semantics with low overhead. Node-API is an ABI stable C interface provided by Node.js for building native addons. It is intended to insulate native addons from changes in the underlying JavaScript engine and allow modules compiled for one version to run on later versions of Node.js without recompilation. The @code{node-addon-api} module, which is not part of Node.js, preserves the benefits of the Node-API as it consists only of inline code that depends only on the stable API provided by Node-API. It is important to remember that @emph{other} Node.js interfaces such as @code{libuv} (included in a project via @code{#include }) are not ABI-stable across Node.js major versions.") (license license:expat))) (define-public node-ansi-styles (package (name "node-ansi-styles") (version "3.2.1") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/chalk/ansi-styles") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "15b5ggrhxi2zw5qlhr2di1b7rmfyacrl4rf8j3ndf8iqkv9fijqd")))) (build-system node-build-system) (inputs (list node-color-convert)) (arguments (list #:tests? #f ; FIXME: Tests require 'xo', 'ava', and 'tsd'. #:phases #~(modify-phases %standard-phases (add-before 'patch-dependencies 'modify-package (lambda _ (modify-json (delete-dev-dependencies))))))) (synopsis "ANSI escape codes for styling strings in the terminal") (description "Library of ANSI escape codes to be used to style strings in terminals.") (home-page (git-reference-url (origin-uri source))) (license license:expat))) (define-public node-array-back (package (name "node-array-back") (version "4.0.2") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/75lb/array-back") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "1xfg4yd155zhi0v2a26kvg3jghcim5xgpwsn4lhikisshmrmf93m")) (modules '((guix build utils))) (snippet #~(begin (delete-file-recursively "dist"))))) (build-system node-build-system) (native-inputs (list esbuild)) (arguments (list #:tests? #f ; FIXME: Tests require 'esm-runner'. #:phases #~(modify-phases %standard-phases (add-before 'patch-dependencies 'modify-package (lambda _ (modify-json (delete-dev-dependencies)))) (replace 'build (lambda _ (invoke "esbuild" "index.mjs" "--format=cjs" "--outfile=dist/index.js")))))) (synopsis "Isomorphic load-anywhere arrayify function") (description "Takes any input and guarantees an array back.") (home-page (git-reference-url (origin-uri source))) (license license:expat))) (define-public node-balanced-match (package (name "node-balanced-match") (version "1.0.2") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/juliangruber/balanced-match") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "0977r6hv9fyv6f8wvn31vcncxwhffnn05y0h4hmpkg8p2vs9ip0b")))) (build-system node-build-system) (arguments (list #:tests? #f ; FIXME Tests require 'tape'. #:phases #~(modify-phases %standard-phases (add-before 'patch-dependencies 'modify-package (lambda _ (modify-json (delete-dev-dependencies))))))) (synopsis "Match balanced character pairs, like { and }") (description "Match balanced string pairs, like { and } or and . Supports\ regular expressions as well!") (home-page (git-reference-url (origin-uri source))) (license license:expat))) (define-public node-bindings (package (name "node-bindings") (version "1.5.0") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/TooTallNate/node-bindings") (commit version))) (file-name (git-file-name name version)) (sha256 (base32 "100gp6kpjvd4j1dqnp0sbjr1hqx5mz7r61q9qy527jyhk9mj47wk")))) (inputs (list node-file-uri-to-path)) (build-system node-build-system) (arguments ;; there are no tests `(#:tests? #f)) (home-page "https://github.com/TooTallNate/node-bindings") (synopsis "Locate native addons") (description "This package provides a helper module to locate native addons in a wide array of potential locations.") (license license:expat))) (define-public node-brace-expansion (package (name "node-brace-expansion") (version "2.0.1") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/juliangruber/brace-expansion") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "113banahmr00n1fnyswdsx2jgpfi05f4hn2gc5i8kka7hmj3b5g1")))) (build-system node-build-system) (inputs (list node-balanced-match)) (arguments (list #:tests? #f ; FIXME Tests require 'tape'. #:phases #~(modify-phases %standard-phases (add-before 'patch-dependencies 'modify-package (lambda _ (modify-json (delete-dev-dependencies))))))) (synopsis "Brace expansion as known from sh/bash, in JavaScript") (description "Return an array of all possible and valid expansions of str. If none\ are found, [str] is returned.") (home-page (git-reference-url (origin-uri source))) (license license:expat))) (define-public node-buffer-crc32 (package (name "node-buffer-crc32") (version "0.2.13") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/brianloveswords/buffer-crc32") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "09qx2mnd898190m50mc0rhyvbm7d677sxz9bn09qmqkz6fnsddgf")))) (build-system node-build-system) (arguments '(#:tests? #f #:phases (modify-phases %standard-phases (add-after 'patch-dependencies 'delete-dependencies (lambda _ (modify-json (delete-dependencies '("tap")))))))) (home-page "https://github.com/brianloveswords/buffer-crc32") (synopsis "CRC32 implementation in Javascript") (description "This package provides a CRC32 algorithm that works with binary data and fancy character sets, signed or unsigned data and has tests, for Node.") (license license:expat))) (define-public node-buffer-from (package (name "node-buffer-from") (version "1.1.2") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/LinusU/buffer-from") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "15x3iix1z2ggfq3gmnjnz809k02g0zbkf391g1if8s7d3q0r0w1b")))) (build-system node-build-system) (arguments (list #:tests? #f ; FIXME: Tests require 'standard'. #:phases #~(modify-phases %standard-phases (add-before 'patch-dependencies 'modify-package (lambda _ (modify-json (delete-dev-dependencies))))))) (synopsis "A ponyfill for Buffer.from") (description "A ponyfill for Buffer.from, uses native implementation if available.") (home-page (git-reference-url (origin-uri source))) (license license:expat))) (define-public node-chalk (package (name "node-chalk") (version "2.4.2") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/chalk/chalk") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "1isx2l8a11k5arz1p3kd7mbdb8kjr85l1axdm7yya57vwlkdkc2y")))) (build-system node-build-system) (inputs (list node-ansi-styles node-supports-color node-escape-string-regexp)) (arguments (list #:tests? #f ; FIXME: Tests reuire 'xo', 'c8', 'ava', and 'tsd'. #:phases #~(modify-phases %standard-phases (add-before 'patch-dependencies 'modify-package (lambda _ (modify-json (delete-dev-dependencies))))))) (synopsis "Terminal string styling library") (description "Chalk comes with an easy to use composable API where you just chain and\ nest the styles you want.") (home-page (git-reference-url (origin-uri source))) (license license:expat))) (define-public node-color-convert (package (name "node-color-convert") (version "1.9.3") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/Qix-/color-convert") (commit version))) (file-name (git-file-name name version)) (sha256 (base32 "0apgv8p1y9hs5z42wwrwrid62vfkfb89kh3a75s9lvqdbyh04390")))) (build-system node-build-system) (inputs (list node-color-name)) (arguments (list #:tests? #f ; FIXME: Tests require 'xo' and 'tsd'. #:phases #~(modify-phases %standard-phases (add-before 'patch-dependencies 'modify-package (lambda _ (modify-json (delete-dev-dependencies))))))) (synopsis "Plain color conversion functions") (description "Color-convert is a color conversion library for JavaScript and node. It\ converts all ways between rgb, hsl, hsv, hwb, cmyk, ansi, ansi16, hex strings, and CSS\ keywords (will round to closest)") (home-page (git-reference-url (origin-uri source))) (license license:expat))) (define-public node-color-name (package (name "node-color-name") (version "1.1.3") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/colorjs/color-name") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "09rbmj16nfwcwkhrybqxyy66bkrs50vpw6hkdqqb14l3gsyxpr74")))) (build-system node-build-system) (home-page "https://github.com/colorjs/color-name") (synopsis "JSON with CSS color names") (description "This package provides a JSON list with color names and their values.") (license license:expat))) (define-public node-command-line-usage (package (name "node-command-line-usage") (version "6.1.3") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/75lb/command-line-usage") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "073blk28qdk1bl1l4jsd4a6fmwvl2jv4fi6kfcjykc8x6hkv84cx")))) (build-system node-build-system) (inputs (list node-chalk node-typical node-array-back node-table-layout)) (arguments (list #:tests? #f ; FIXME: Tests require 'test-runner'. #:phases #~(modify-phases %standard-phases (add-before 'patch-dependencies 'modify-package (lambda _ (modify-json (delete-dev-dependencies))))))) (synopsis "Generates command-line usage information") (description "A simple, data-driven module for creating a usage guide.") (home-page (git-reference-url (origin-uri source))) (license license:expat))) (define-public node-crx3 (package (name "node-crx3") (version "1.1.3") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/ahwayakchih/crx3") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "1snqyw8c3s9p2clhqh1172z0rs1was36sfxkk6acgpar32c2rwzw")))) (build-system node-build-system) (arguments '(#:tests? #f #:phases (modify-phases %standard-phases (add-after 'unpack 'replace-mri-by-minimist (lambda _ (substitute* "package.json" (("\"mri\": \"\\^1\\.1\\.6\",") "\"minimist\": \"^1.2.6\",")) (substitute* "lib/configuration.js" (("mri") "minimist")))) (add-after 'patch-dependencies 'delete-dependencies (lambda _ (modify-json (delete-dependencies '("c8" "docdash" "eslint" "eslint-plugin-jsdoc" "jsdoc" "tap-diff" "tape" "tape-catch")))))))) (inputs (list node-minimist node-pbf node-yazl)) (home-page "https://github.com/ahwayakchih/crx3") (synopsis "Create CRXv3 browser extensions with Javascript") (description "This package creates web extension files (CRXv3) for Chromium versions 64.0.3242 and above and all other browsers supporting the file format and API.") (license license:bsd-3))) (define-public node-debug (package (name "node-debug") (version "4.3.3") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/debug-js/debug") (commit version))) (file-name (git-file-name name version)) (sha256 (base32 "0ji0dmdl2xkgxqxvd6xjy7k3mmknmhvqjgc40vyly9ka1mpf20vb")))) (inputs (list node-ms)) (build-system node-build-system) (arguments `(#:phases (modify-phases %standard-phases (add-after 'patch-dependencies 'delete-dependencies (lambda args (modify-json (delete-dependencies `("brfs" "browserify" "coveralls" "istanbul" "karma" "karma-browserify" "karma-chrome-launcher" "karma-mocha" "mocha" "mocha-lcov-reporter" "xo" "supports-color")))))) #:tests? #f)) (home-page "https://github.com/debug-js/debug") (synopsis "Debugging utility for Node.js") (description "The @code{debug} module exposes a function, which if called with a module name as argument provides a function that writes debug output to @code{console.error} under that module name. This output can be controlled in a more fine-grained manner by binding the @env{DEBUG} variable.") (license license:expat))) (define-public node-deep-extend (package (name "node-deep-extend") (version "0.6.0") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/unclechu/node-deep-extend") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "0r2r0wc1c9lq8gplis17pr220c7hk18sq12cipvsa7krb2lb4cpb")))) (build-system node-build-system) (arguments (list #:tests? #f ; FIXME: Tests require 'mocha'. #:phases #~(modify-phases %standard-phases (add-before 'patch-dependencies 'modify-package (lambda _ (modify-json (delete-dev-dependencies))))))) (synopsis "Recursive object extending") (description "Library which allows deeply merging two different objects.") (home-page (git-reference-url (origin-uri source))) (license license:expat))) (define-public node-dprint-formatter (package (name "node-dprint-formatter") (version "0.4.1") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/dprint/js-formatter") (commit version))) (file-name (git-file-name name version)) (sha256 (base32 "0ihdspyz7brx1rny2ind715z6rlzncslsigi3yr553xmk18iswm2")))) (build-system node-build-system) (native-inputs (list esbuild)) (arguments (list #:modules '( (guix build node-build-system) (guix build utils) (ice-9 match) (json)) #:tests? #f ; FIXME: Tests require 'deno'. #:phases #~(modify-phases %standard-phases (delete 'patch-dependencies) (delete 'configure) (replace 'build (lambda _ (define output "output") (mkdir output) (delete-file "mod_test.ts") (substitute* (list "mod.ts" "v3.ts" "v4.ts") (("\\.ts") "")) (install-file "LICENSE" output) (install-file "README.md" output) (chdir output) (call-with-output-file "package.json" (lambda (out) (scm->json (list (cons "name" "@dprint/formatter") (cons "version" #$version) (cons "main" "./script/mod.js") (cons "module" "./esm/mod.js")) out))) (for-each (match-lambda ((format outdir) (invoke "esbuild" "../*.ts" (string-append "--format=" format) "--platform=node" (string-append "--outdir=" outdir)))) (list (list "cjs" "script") (list "esm" "esm")))))))) (synopsis "Wasm formatter for dprint plugins") (description "A JS formatter which uses WASM plugins for dprint.") (home-page (git-reference-url (origin-uri source))) (license license:expat))) (define-public node-env-variable (package (name "node-env-variable") (version "0.0.4") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/bigpipe/env-variable") (commit version))) (file-name (git-file-name name version)) (sha256 (base32 "0nnpxjxfhy4na7fixb7p3ww6ard5xgggfm83b78i333867r4gmsq")))) (build-system node-build-system) (arguments '(#:tests? #f)) ; No tests. (home-page "https://github.com/bigpipe/env-variable") (synopsis "Environment variables for Node with fallbacks") (description "This package provides environment variables with @code{process.env}, @code{window.name}, @code{location.hash} and @code{localStorage} fallbacks.") (license license:expat))) (define-public node-escape-string-regexp (package (name "node-escape-string-regexp") (version "1.0.5") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/sindresorhus/escape-string-regexp") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "0iv0zd2r1mr3w966n023wqghcyaw37w3wl07is45hy74rrnq6z0v")))) (build-system node-build-system) (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 "Escape RegExp special characters") (description "This library takes a string and escapes the regex characters such that\ the string can be inserted into a regex expression without triggering any special\ characters.") (home-page (git-reference-url (origin-uri source))) (license license:expat))) (define-public node-far (package (name "node-far") (version "0.0.7") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/felixge/node-far") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "083rv1rszjn0i91zcpaghlid0kwhk0angmpj4hiflrlyhd6cmjzw")))) (build-system node-build-system) (arguments '(#:phases (modify-phases %standard-phases (replace 'check (lambda _ ;; We skip the two tests which are supposed to fail. (invoke "bin/node-far" "-v" "test/" "-e" "test.*fail.js")))))) (inputs (list node-oop)) (home-page "https://github.com/felixge/node-far") (synopsis "Node.js test runner") (description "This package provides a simple test runner that finds and runs multiple node.js files, while providing useful information about output and exit codes.") (license license:expat))) (define-public node-fast-xml-parser (package (name "node-fast-xml-parser") (version "4.5.3") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/NaturalIntelligence/fast-xml-parser") (commit "f8d4d427a31a52d4df82260ac1973d94ad73335b"))) (file-name (git-file-name name version)) (sha256 (base32 "1wc5mgihrgync0vj79gk7g367rssqhzmzxl41kdhhcya045bis85")) (modules '((guix build utils))) (snippet #~(begin (delete-file-recursively "lib"))))) (build-system node-build-system) (inputs (list node-strnum)) (arguments (list #:tests? #f ; FIXME: Tests require 'nyc'. #:phases #~(modify-phases %standard-phases (add-before 'patch-dependencies 'modify-package (lambda _ (modify-json (delete-dev-dependencies)))) (replace 'build (lambda _ (define output "output") (mkdir output) (for-each (lambda (file) (install-file file output)) (list "CHANGELOG.md" "LICENSE" "package.json" "README.md")) (copy-recursively "src" (string-append output "/src")) (chdir output)))))) (synopsis "Validate XML, Parse XML, Build XML without C/C++ based libraries") (description "Validate XML, Parse XML to JS Object, or Build XML from JS Object\ without C/C++ based libraries and no callback. * Validate XML data syntactically. Use detailed-xml-validator to verify business rules. * Parse XML to JS Objectand vice versa * Common JS, ESM, and browser compatible * Faster than any other pure JS implementation. It can handle big files (tested up to 100mb). XML Entities, HTML entities, and DOCTYPE\ entites are supported. Unpaired tags (Eg
in HTML), stop nodes (Eg