mos-plugin-installation
A mos plugin for creating installation section
Installation
npm install --save mos-plugin-installation
Usage
Add this code snippet to your README.md
<!--@installation()--><!--/@-->
Run mos
in the terminal.
You'll get an installation section in your README that will instruct how to install the package via npm.
The plugin will use information from the package.json
in order to figure out what should the installation command look like.
- If there is a
preferGlobal: true
specified in thepackage.json
, the generated command will benpm install --global
- If there is a
preferDev: true
specified in thepackage.json
, the generated command will benpm install --save-dev
- If there is a
private: true
, the command instruction will suggest to clone the repo and install its dependencies - Otherwise, the generated command will be
npm install --save
If the package has peerDependencies
, the installation command will suggest to install all the peer dependencies with the package.
API
installation(opts)
opts.useShortAlias
- Boolean, false by default. If true, uses shorter aliases in the installation command.i
instead ofinstall
,-S
instead of--save
, etc.