0.3.1 • Published 9 years ago
justo-plugin-npm v0.3.1
Plugin for the npm command.
Proudly made with ♥ in Valencia, Spain, EU.
Install
npm install justo-plugin-npmUse
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 ofpkgwhen package name indicated.global(boolean). Install globally? Default:false.output(boolean). Show thenpm installoutput: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:
folderordir(string). The package folder path.who(string). The user name. Ifnpm whois another than the specified one, the task fails.output(boolean). Show thenpm publishoutput: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"
});