@ethronpi/npm
v0.3.0
Published
Ethron.js plugin for running NPM commands.
Downloads
1
Readme
@ethronpi/npm
Ethron.js plugin for running NPM commands.
Developed in Dogma, compiled to JavaScript.
Engineered in Valencia, Spain, EU by EthronLabs.
Use
const npm = require("@ethronpi/npm");
npm.install task
This task installs a package:
npm.install({pkg, global, force, loglevel})
pkg
(string, required). The package name or folder.global
(bool). Would you like to install it globally? Default:false
.force
(bool). Would you like to force the installation? Default:false
.loglevel
(string). Log level:silent
,error
,warn
,notice
,info
...
npm.uninstall task
This task uninstalls a package:
npm.uninstall({pkg, global})
pkg
(string, required). The package name.global
(bool). Would you like to uninstall it globally? Default:false
.
npm.publish task
This task publishes a package in NPM:
npm.publish({path, who, access, tag})
path
(string, required). Folder path.who
(string). The user name to use. Ifnpm who
returns another, the task fails.access
(string):public
orrestricted
.tag
(string). The publication tag.
npm.who task
This task returns the npm who
command:
npm.who() : string
npm.bin task
This task runs a command from the ./node_modules/.bin
folder:
bin({cmd, args})
cmd
(string, required). Command to run.args
(string). Arguments.detach
(bool). Would you like to detach process? Default:false
.
Example:
npm.bin({
cmd: "http-server",
args: "dist -p 8080 -c-1",
detach: true
});
npm.run
This task runs a script:
run({script})
script
(string, required). Script to run.
Example:
npm.run({
script: "test"
});