Yardım - Referans

1
2
3
4
5
npm help <command>
# Help for specific npm commands
npm <command> -h
# quick command parameter reference

npm için defaultlar

1
2
3
4
npm init -y
npm config set init.author.name <name>
npm config set init.author.email <email>

Paketler

1
2
3
4
5
6
7
8
9
10
11
12
13
npm list
# ls, la and ll can be used as aliases for list
npm list --depth=0
npm list -g --depth=0
# A package homepage can be opened with:
npm home <package>
# or its documentation:
npm docs <package>
# or its repo:
npm repo <package>

Dependency Kilit

By default, npm references package version numbers with the caret (^) character when installing a package with –save or –save-dev

1
2
3
4
5
npm shrinkwrap
# generates an npm-shrinkwrap.json file. This allows you to pin the dependencies of your project to the specific version you’re currently using within your node_modules directory.
npm config set save-prefix="~"
npm config set save-exact true

Outdated Paketler

1
2
3
4
npm outdated
# examine the current and historical versions:
npm view <package> versions

Güncellemeler

1
2
3
4
npm install -g npm
# You may also need to rebuild C++ addons when a new major version of Node is released
npm rebuild

Muhtelif

  • npm run foo will also run prefoo and postfoo if you have them
  • You can install GitHub repos with npm i org-name/repo-name