justo-plugin-npm

0.3.1 • Public • Published

NPM version Build Status Dependency Status devDependency Status

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 of pkg when package name indicated.
  • global (boolean). Install globally? Default: false.
  • output (boolean). Show the npm 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 or dir (string). The package folder path.
  • who (string). The user name. If npm who is another than the specified one, the task fails.
  • output (boolean). Show the npm 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"
});

Package Sidebar

Install

npm i justo-plugin-npm

Weekly Downloads

3

Version

0.3.1

License

none

Last publish

Collaborators

  • justojs