justo-plugin-npm
v0.3.1
Published
Plugin for NPM.
Downloads
8
Maintainers
Readme
Plugin for the npm
command.
Proudly made with ♥ in Valencia, Spain, EU.
Install
npm install justo-plugin-npm
Use
const npm = require("justo-plugin-npm");
Tasks
install task
Install a package:
install(opts, pkg : string)
install(opts, config : object)
The config
parameter:
pkg
(string). The package name or folder.name
(string). The package name. Alias ofpkg
when package name indicated.global
(boolean). Install globally? Default:false
.output
(boolean). Show thenpm install
output:true
, yep;false
, nope. Default:true
.
Example:
const install = require("justo-plugin-npm").install;
install("Install package", {
pkg: "dist/es5/node/justo-generator-horizon/",
global: true
});
install("Install horizon package", {
name: "horizon",
global: true
});
publish task
Publish a package:
publish(opts, folder : string)
publish(opts, config : object)
The config
parameter:
folder
ordir
(string). The package folder path.who
(string). The user name. Ifnpm who
is another than the specified one, the task fails.output
(boolean). Show thenpm publish
output:true
, yep;false
, nope. Default:true
.
Example:
const publish = require("justo-plugin-npm").publish;
publish("NPM publication", "./dist/nodejs/mypackage");
publish("NPM publication", {
who: "myuser",
folder: "./dist/nodejs/mypackage"
});