Alex Dai Playground

[npm] package.json

| Comments

save as dependency package

npm install $PACKAGE_NAME --save

save as devDependencies package

npm install $PACKAGE_NAME --save-dev

只載入 dependency 的 package

$ npm install --production

檢查套件更新

npm outdated

npm scripts

# pre/post scripts
{
  "scripts": {
    "hello": "echo World",
    "prehello": "echo Hello",
    "posthello": "echo !!!"
  }
}

執行 $ npm run hello 結果

Hello
World
!!!

npm

Comments

comments powered by Disqus