create-nm

1.0.7 • Public • Published

create-nm

NPM version Build status Coverage status Dependency status CircleCI

npm init nm to create a npm module.

Never manually do the linting, versioning, tagging, editing changelog and pushing commit, unleash the power of hooks.

Create a npm module

  • use npm
# choose one of the following methods 
$ npm init nm [name]
$ npx create-nm [name]
$ npm i -g create-nm && create-nm [name]
  • use yarn
$ yarn create nm [name]

Workflow of publishing a npm module

Commit and publish, everything will be done automatically.

$ git commit
$ npm publish
                       +-------------------+
version :  1.1.0       |                   |
    tag : v1.1.0       |   $ git commit    |
                       |                   |
                       +--+----------------+
                          |
                          +-> lint-staged

                       +-------------------+
                       |                   |
                       |   $ git commit    |
                       |                   |
                       +--+----------------+
                          |
                          +-> lint-staged

                                 +
                                 |
                                 |
                                 |
                                 v

                       +-------------------+
                       |                   |
version :  1.1.1       |  $ npm publish    |
    tag : v1.1.1       |                   |
                       +--+----------------+
                          |
                          |   update npm version
                          |   update CHANGELOG.md
                          |   commit version with changelog
                          +-> add git tag
                              git push commit
                              npm publish

Optional workflow

Use git cz instead of git commit, this will generate better changelog. You need to install commitizen and create ~/.czrc.

$ npm install commitizen -g
echo '{ "path": "cz-conventional-changelog" }' > ~/.czrc

Workflow:

$ git cz
$ npm publish

Related

  • np A better npm publish.
  • commitizen Simple commit conventions for internet citizens.
  • conventional-changelog Generate a changelog from git metadata.
  • lint-staged Lint files staged by git.
  • husky Prevents bad commit or push (git hooks, pre-commit/precommit, pre-push/prepush, post-merge/postmerge and all that stuff...)].

License

MIT

/create-nm/

    Package Sidebar

    Install

    npm i create-nm

    Weekly Downloads

    4

    Version

    1.0.7

    License

    MIT

    Unpacked Size

    17.5 kB

    Total Files

    18

    Last publish

    Collaborators

    • marmot.antgroup
    • xingxia
    • gxkl
    • zyhack
    • shaytang
    • kobe990