@emdaer/cli

emdaer CLI

Stats

StarsIssuesVersionUpdatedCreatedSize
@emdaer/cli
14293.2.31a year ago4 years agoMinified + gzip package size for @emdaer/cli in KB

Readme

@emdaer/cli ยท Travis Documented with emdaer Maintained with lerna

emdaer CLI

Usage

@emdaer/cli is the emdaer cli โ€“ see the emdaer monorepo for more information

Documentation

Adding emdaer to your project

We recommend using emdaer with lint-staged and husky.

Install dependencies:

npm install --save-dev @emdaer/cli @emdaer/plugin-value-from-package lint-staged husky

or with yarn:

yarn add @emdaer/cli @emdaer/plugin-value-from-package lint-staged husky -D

Follow the lint-staged setup instructions.

{
  "scripts": {
+   "emdaer": "emdaer && git add *.md",
+   "precommit": "lint-staged"
  }
}

In your lint-staged config file add an entry for emdaer:

module.exports = {
  '*.js': ['eslint --fix', 'prettier --write', 'git add'],
+ '*.emdaer.md': ['emdaer --yes', 'git add'],
};

NOTE: In the case of a precommit hook (or CI/other automation), we donโ€™t want to be prompted about anything. The --yes flag will automatically answer โ€œyesโ€ to any prompts. For example, it will make emdaer write your READMEs without prompting about overwritting direct changes to a destination README file.

Add a .emdaer/README.emdaer.md file:

# <!--emdaer-p
  - '@emdaer/plugin-value-from-package'
  - value: name
-->

And give it a whirl:

npm run emdaer

When you commit your changes, lint-staged will run emdaer on any *.emdaer.md files you may have changed.

Manual Usage

emdaer can be run manually against files by providing space separated file paths:

npm run emdaer -- .emdaer/README.emdaer.md .emdaer/CONTRIBUTING.emdaer.md

If emdaer is not provided a path, the default glob .emdaer/**/*.emdaer.md is searched:

npm run emdaer

NOTE: By default, emdaer checks for existing changes to your READMEs before writing. If it detects changes, it will provide a prompt asking if you would like to overwrite the README with the newly generated content. If you accidentally edited the README directly, you will want to answer n to the prompt, move any changes to the respective .emdaer/*.emdaer.md file, and rerun emdaer. If you would like to discard those changes, answer Y to the prompt or use the --yes flag to skip the prompt all together. In both cases, emdaer will overwrite the README with the newly generated content.

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.