@ethronjs/plugin.npm

0.2.0 • Public • Published

@ethronjs/plugin.npm

NPM version Total downloads

Ethron.js plugin for running NPM commands.

Developed in Dogma, compiled to JavaScript.

Engineered in Valencia, Spain, EU by EthronLabs.

Use

const npm = require("@ethronjs/plugin.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})
  • path (string, required). Folder path.
  • who (string). The user name to use. If npm who returns another, the task fails.
  • access (string): public or restricted.
  • 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"
});

Readme

Keywords

none

Package Sidebar

Install

npm i @ethronjs/plugin.npm

Weekly Downloads

1

Version

0.2.0

License

none

Unpacked Size

9.94 kB

Total Files

9

Last publish

Collaborators

  • ethronjs