Scroll to navigation

PKGJS-UTILS(1p) User Contributed Perl Documentation PKGJS-UTILS(1p)

NAME

pkgjs-utils - Nodejs package utilities

SYNOPSIS

  $ 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: { <package.json content, serialized> }
  $ pkgjs-pjson .
    # alias for pkgjs-utils pjson .
  $ cd ../node-jest
  $ pkgjs-pjson packages/jest-diff
    # prints: { <packages/jest-diff/package.json content, serialized> }
  $ 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: 'webpack linked into node_modules
  $ pkgjs-utils ln @types/node
    # prints: '@types/node' 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)

DESCRIPTION

Collection of little commands to read <component>/package.json overridden by debian/nodejs/<component>/* files.

Available commands

Link modules that are in the debian/tests/test_modules directory into "node_modules".
Link Debian modules listed into debian/nodejs/extlinks into "node_modules" and copy modules listed into debian/nodejs/extcopies into "node_modules".
In multi-modules package (with uscan components and/or lerna/workspace), link these modules into "node_modules", except the "main" module.
Link modules that are in the debian/build_modules directory into "node_modules".
Drop links created by link_test_modules.
Drop links/copies created by link_external_modules.
Drop links created by link_internal_modules.
Drop links created by link_build_modules.
Link the given Debian module into "node_modules".

If "-t" option is set, try to link the corresponding typescript declarations. For example:

    $ pkgjs-ln -t glob; pkgjs-ln -t abab
    

creates "node_modules/@types/glob" and "node_modules/abab".

Print the list of components (directories) without the "main" module.
Print the NPM names of components without the "main" module.
Reads the package.json or package.yaml 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:

    $ pkgjs-pjson packages/foo scripts run
    

write the content of the subkey "run" of the key "scripts".

Print the NPM name of the "main" module.
Print the list of binary packages from "debian/control".
Convert a NPM module name into a Debian compatible name. Examples:

    $ 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
    

AUTHOR

Yadd <yadd@debian.org>

COPYRIGHT AND LICENSE

Copyright (C) 2021 by Yadd <yadd@debian.org>

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'

2024-04-22 perl v5.38.2