.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "PKGJS-UTILS 1p" .TH PKGJS-UTILS 1p 2024-04-22 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME pkgjs\-utils \- Nodejs package utilities .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 10 \& $ cd node\-glob \& $ pkgjs\-utils main \& # prints: glob \& $ pkgjs\-main \& # alias for pkgjs\-utils main \& $ pkgjs\-utils components_list \& # prints: \& # globalyzer \& # globrex \& # tiny\-glob \& # types\-glob \& $ pkgjs\-utils modules_list \& # prints: \& # globalyzer \& # globrex \& # tiny\-glob \& # @types/glob \& $ pkgjs\-utils pjson . \& # prints: { } \& $ pkgjs\-pjson . \& # alias for pkgjs\-utils pjson . \& $ cd ../node\-jest \& $ pkgjs\-pjson packages/jest\-diff \& # prints: { } \& $ pkgjs\-pjson packages/jest\-diff version \& # prints: 27.2.5 \& $ pkgjs\-utils pjson . scripts test \& # prints: jest \& $ pkgjs\-utils pjson packages/jest\-diff scripts test \& $ pkgjs\-utils ln webpack \& # prints: \*(Aqwebpack linked into node_modules \& $ pkgjs\-utils ln @types/node \& # prints: \*(Aq@types/node\*(Aq linked into node_modules \& $ pkgjs\-ln @types/node \& # same as pkgjs\-utils ln @types/node \& $ pkgjs\-utils normalize_name @types/node \& # prints: types\-node \& $ pkgjs\-utils root_components_list (only components installed in nodejs dir) \& $ pkgjs\-utils root_modules_list (same with module names) \& $ pkgjs\-utils ordered_components_list (components in build order) .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" Collection of little commands to read /package.json overridden by debian/nodejs//* files. .SS "Available commands" .IX Subsection "Available commands" .IP \fBlink_test_modules\fR 4 .IX Item "link_test_modules" Link modules that are in the \fBdebian/tests/test_modules\fR directory into "node_modules". .IP \fBlink_external_modules\fR 4 .IX Item "link_external_modules" Link Debian modules listed into \fBdebian/nodejs/extlinks\fR into "node_modules" and copy modules listed into \fBdebian/nodejs/extcopies\fR into "node_modules". .IP \fBlink_internal_modules\fR 4 .IX Item "link_internal_modules" In multi-modules package \fI(with \fR\f(BIuscan\fR\fI components and/or lerna/workspace)\fR, link these modules into "node_modules", except the "main" module. .IP \fBlink_build_modules\fR 4 .IX Item "link_build_modules" Link modules that are in the \fBdebian/build_modules\fR directory into "node_modules". .IP \fBclean_test_modules\fR 4 .IX Item "clean_test_modules" Drop links created by \fBlink_test_modules\fR. .IP \fBclean_external_modules\fR 4 .IX Item "clean_external_modules" Drop links/copies created by \fBlink_external_modules\fR. .IP \fBclean_internal_modules\fR 4 .IX Item "clean_internal_modules" Drop links created by \fBlink_internal_modules\fR. .IP \fBclean_build_modules\fR 4 .IX Item "clean_build_modules" Drop links created by \fBlink_build_modules\fR. .IP \fBln\fR 4 .IX Item "ln" Link the given Debian module into "node_modules". .Sp If "\-t" option is set, try to link the corresponding typescript declarations. For example: .Sp .Vb 1 \& $ pkgjs\-ln \-t glob; pkgjs\-ln \-t abab .Ve .Sp creates "node_modules/@types/glob" and "node_modules/abab". .IP \fBcomponents_list\fR 4 .IX Item "components_list" Print the list of components (directories) without the "main" module. .IP \fBmodules_list\fR 4 .IX Item "modules_list" Print the NPM names of components without the "main" module. .IP \fBpjson\fR 4 .IX Item "pjson" Reads the package.json \fIor package.yaml\fR of the given directory. If no arguments are given, it prints the serialized JSON content. If arguments are given, it tries to follow keys. For example: .Sp .Vb 1 \& $ pkgjs\-pjson packages/foo scripts run .Ve .Sp write the content of the subkey "run" of the key "scripts". .IP \fBmain\fR 4 .IX Item "main" Print the NPM name of the "main" module. .IP \fBpackages_list\fR 4 .IX Item "packages_list" Print the list of binary packages from "debian/control". .IP \fBnormalize_name\fR 4 .IX Item "normalize_name" Convert a NPM module name into a Debian compatible name. Examples: .Sp .Vb 6 \& $ pkgjs\-utils normalize_name @types/glob \& type\-glob \& $ pkgjs\-utils normalize_name @types/babel_\|_type \& types\-babel\-type \& $ pkgjs\-utils normalize_name require_optional \& require\-optional .Ve .IP "\fB\-h\fR \fB\-\-help\fR" 4 .IX Item "-h --help" .PD 0 .IP "\fB\-v\fR \fB\-\-version\fR" 4 .IX Item "-v --version" .PD .SH AUTHOR .IX Header "AUTHOR" Yadd .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" Copyright (C) 2021 by Yadd .PP This program 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 2, or (at your option) any later version. \&. On Debian systems, the complete text of version 2 of the GNU General Public License can be found in `/usr/share/common\-licenses/GPL\-2'