这里记录一些自己平时用到的 NPM 小技巧. Enjoy ~

  1. 设置package.json 默认用户名和密码
  2. 依赖版本号严格控制(记录安装时的版本号)

1.设置默认 用户名, 邮箱, License

      npm set init-author-name "foo"
      npm set init-author-email "foo@email.com"
      npm set init-license "MIT"

2.依赖版本号严格控制

      npm set save-exact true

Dependencies saved to package.json using –save, –save-dev or –save-optional will be configured with an exact version rather than using npm’s default semver range operator.