Skip to content

Instantly share code, notes, and snippets.

@yukidarake
Created May 30, 2014 10:06
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save yukidarake/a7bd9d5fc333e1d9f31f to your computer and use it in GitHub Desktop.
Save yukidarake/a7bd9d5fc333e1d9f31f to your computer and use it in GitHub Desktop.
npm系の知識(若干マニアック)
# npm自体をアップデート
npm update -g npm
# npm installのエイリアス
npm i
# tar.gzもインストールできる
npm i https://github.com/yukidarake/node-qc/archive/0.0.2.tar.gz
# githubからインストールできる
npm i -g yukidarake/node-qc
# package.jsonに保存
npm i --save
npm i --save-dev
# dev-dependenciesのものはインストールしない
npm i --production
# package.jsonのバージョンを上げる
npm version major
npm version minor
npm version patch
npm version 2.0.1
# 重複してインストールされているモジュールをまとめる
npm dedupe
# ローカルインストール時に、モジュールの実行ファイルがインストールされる場所
./node_modules/.bin/mocha
# いろいろMakefile的なこともできる
# https://www.npmjs.org/doc/misc/npm-scripts.html
npm start
npm stop
npm prestart
npm test
# これを.bashrcに追記すればnpmコマンドの補完が可能になる
npm completion
# まだまだある・・・
# https://www.npmjs.org/doc/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment