Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
pkg update packages Feb 10, 2019
src
README.md readme first pass Feb 2, 2019
package-lock.json
package.json update packages Feb 10, 2019

README.md

@pika/plugin-simple-bin

A @pika/pack build plugin. Adds a simple CLI wrapper to your package and properly configures your package.json "bin" field to point to it. Useful for quickly adding a command line interface to your library.

Install

# npm:
npm install @pika/plugin-simple-bin --save-dev
# yarn:
yarn add @pika/plugin-simple-bin --dev

Usage

{
  "name": "example-package-json",
  "version": "1.0.0",
  "@pika/pack": {
    "pipeline": [
      ["@pika/plugin-standard-pkg"],
      ["@pika/plugin-build-node"],
      ["@pika/plugin-simple-bin", {"bin": "my-cli"}]
    ]
  }
}

For more information about @pika/pack & help getting started, check out the main project repo.

Result

  1. Adds a simple bin/CLI wrapper to your built package: dist-node/index.bin.js
  2. Built for Node.js
  3. Loads your library, and calls an exported run() method with the CLI args.
  4. Will load a bundled Node.js distribution if one exists.
  5. Configures the built package.json with a new "bin" entrypoint, so that npm knows to install your package as a CLI.