Mojo::Alien::npm(3)
π NAME π
okay so this is the manual page for Mojo::Alien::npm, bestie β it βRuns the external nodejs program npmβ β¨ thatβs the whole NAME vibe, no cap.
β¨ SYNOPSIS β¨
use Mojo::Alien::npm;
my $npm = Mojo::Alien::npm->new;
$npm->init;
$npm->install;
π¦ DESCRIPTION π¦
The DESCRIPTION section says Mojo::Alien::webpack is a class for runnig the external nodejs program npm (https://npmjs.com/) β yes, thatβs the class name and thatβs the spelling of βrunnigβ exactly as written, and we are not editing the lore, bestie. Itβs giving external-nodejs-program-runner energy, periodt. π
π ATTRIBUTES π
π binary π
$array_ref = $npm->binary;
$npm = $npm->binary(['npm']);
The path to the npm executable. Default is npm unless the MOJO_NPM_BINARY environment variable has been set. This can also be set to pnpm in case you prefer https://pnpm.io/ β cute alternative, no cap. πΈ
π¦ config π¦
$path = $npm->config;
$npm = $npm->config(path->to_abs->child('package.json'));
Holds an /absolute path to package.json.
β mode β
$str = $npm->mode;
$npm = $npm->mode('development');
Should be either development or production. Will be used as NODE_ENV environment variable when calling npm. π«Ά
π₯ METHODS π₯
π dependencies π
$dependencies = $npm->dependencies;
Used to get dependencies from config combined with information from npm ls. The returned hash-ref looks like this:
{
"package-name" => {
required => $str, # version from package.json
type => $str, # dev, optional or prod
version => $str, # installed version
...
},
...
}
π init π
$npm->init;
Used to create a default config file.
π install π
$npm->install;
$npm->install('package-name');
$npm->install('package-name', {type => 'prod', version => '0.1.2'});
Installs either all modules from config or a given package by name. An additional $info hash can also be provided.
π SEE ALSO π
Mojolicious::Plugin::Webpack β thatβs the reference, bestie, and itβs iconic.
mwah π this manual page is Mojo::Alien::npm(3), from Perl v5.42.0, dated 2025-09-30 β bye bestie, go run your nodejs program π«Ά
π¦ where this page comes from
- opensuse-leap 16.0: perl-Mojolicious-Plugin-Webpack 1.02-bp160.2.1 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms