From 4d04cab8cef28dbacb41270b9bdbd6c6ef5f0011 Mon Sep 17 00:00:00 2001 From: Sergio Gomez Date: Thu, 14 Jun 2018 19:36:41 -0500 Subject: [PATCH 1/3] docs(readme): add npx use examples closes #502 --- README.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8bf0cd2b..8c8675d0 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,18 @@ npm install -g commitizen #### Using the command line tool Now, simply use `git cz` instead of `git commit` when committing. +_Alternatively_, if you are using **Node 10+** you can use `npx` instead of installing globally: +``` +npx git-cz +``` +or as an npm script: +```json + ... + "scripts": { + "commit": "npx git-cz" + } +``` + When you're working in a Commitizen friendly repository, you'll be prompted to fill in any required fields and your commit messages will be formatted according to the standards defined by project maintainers. [![Add and commit with Commitizen](https://github.com/commitizen/cz-cli/raw/master/meta/screenshots/add-commit.png)](https://github.com/commitizen/cz-cli/raw/master/meta/screenshots/add-commit.png) @@ -101,7 +113,12 @@ Installing and running Commitizen locally allows you to make sure that developer Install Commitizen with `npm install --save-dev commitizen`. -Once you have Commitizen installed as a local dev dependency you can execute `./node_modules/.bin/commitizen` or `./node_modules/.bin/git-cz` in order to actually use the commands. +On **Node v10+** you can use `npx` to initialize the conventional changelog adapter: +``` +npx commitizen init cz-conventional-changelog --save-dev --save-exact +``` + +For **previous versions of Node (<= 9) ** you can execute `./node_modules/.bin/commitizen` or `./node_modules/.bin/git-cz` in order to actually use the commands. You can then initialize the conventional changelog adapter using: `./node_modules/.bin/commitizen init cz-conventional-changelog --save-dev --save-exact` From 7bc5c8c1fd4eab052b3321a62c12ac94ab772bf9 Mon Sep 17 00:00:00 2001 From: Sergio Gomez Date: Sun, 17 Jun 2018 21:21:53 -0500 Subject: [PATCH 2/3] docs(readme): add npx use examples clarify that npx is available with NPM 5.2+ --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8c8675d0..28b7194e 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ npm install -g commitizen #### Using the command line tool Now, simply use `git cz` instead of `git commit` when committing. -_Alternatively_, if you are using **Node 10+** you can use `npx` instead of installing globally: +_Alternatively_, if you are using **NPM 5.2+** you can [use `npx`](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b) instead of installing globally: ``` npx git-cz ``` @@ -113,7 +113,7 @@ Installing and running Commitizen locally allows you to make sure that developer Install Commitizen with `npm install --save-dev commitizen`. -On **Node v10+** you can use `npx` to initialize the conventional changelog adapter: +On **NPM 5.2+** you can [use `npx`](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b) to initialize the conventional changelog adapter: ``` npx commitizen init cz-conventional-changelog --save-dev --save-exact ``` From 7f3c775d2da32c086d6eb28979599d11506da867 Mon Sep 17 00:00:00 2001 From: Sergio Gomez Date: Sun, 17 Jun 2018 22:11:58 -0500 Subject: [PATCH 3/3] docs(readme): add npx use examples correct Node to NPM --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 28b7194e..d290edf0 100644 --- a/README.md +++ b/README.md @@ -118,7 +118,7 @@ On **NPM 5.2+** you can [use `npx`](https://medium.com/@maybekatz/introducing-np npx commitizen init cz-conventional-changelog --save-dev --save-exact ``` -For **previous versions of Node (<= 9) ** you can execute `./node_modules/.bin/commitizen` or `./node_modules/.bin/git-cz` in order to actually use the commands. +For **previous versions of NPM (< 5.2) ** you can execute `./node_modules/.bin/commitizen` or `./node_modules/.bin/git-cz` in order to actually use the commands. You can then initialize the conventional changelog adapter using: `./node_modules/.bin/commitizen init cz-conventional-changelog --save-dev --save-exact`