๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
Frontend/JavaScript

[ ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ(JavaScript) ] ์•Œ์•„๋‘๋ฉด ๋„์›€๋˜๋Š” npm commands

by YWTechIT 2022. 12. 13.
728x90

๐Ÿ“ ์•Œ์•„๋‘๋ฉด ๋„์›€๋˜๋Š” npm commands

์ด๋ฒˆ์— ์•Œ์•„๋ณผ npm ๋ช…๋ น์–ด๋Š” npm run ...์ฒ˜๋Ÿผ ๋งค๋ฒˆ ์‚ฌ์šฉ๋˜๋Š” ๊ฒƒ์€ ์•„๋‹ˆ์ง€๋งŒ, ๋งˆ์šฐ์Šค๋กœ ์กฐ์ž‘ํ•˜๊ธฐ ๋ฒˆ๊ฑฐ๋กœ์šธ ๋•Œ ๋„์›€๋˜๋Š” ๋ช…๋ น์–ด๋“ค์ด๋‹ค.

728x90
  1. npm docs [package-name]: ํ•ด๋‹น ํŒจํ‚ค์ง€์˜ docs๋ฅผ ๋ณผ ์ˆ˜ ์žˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด npm docs lodash๋ฅผ ์ž…๋ ฅํ•˜๋ฉด lodash docs๋ฅผ ๋ณผ ์ˆ˜ ์žˆ๋‹ค.(ํ•ด๋‹น ํŒจํ‚ค์ง€๊ฐ€ ํ”„๋กœ์ ํŠธ์— ์„ค์น˜๋˜์–ด ์žˆ์ง€ ์•Š์•„๋„ ๋ณผ ์ˆ˜ ์žˆ๋‹ค.)
  2. npm repo [package-name]: ํ•ด๋‹น ํŒจํ‚ค์ง€๋ฅผ GitHub์—์„œ ๋ณผ ์ˆ˜ ์žˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด npm repo lodash๋ฅผ ์ž…๋ ฅํ•˜๋ฉด GitHub์˜ lodash/lodashํŽ˜์ด์ง€๋ฅผ ๋ณผ ์ˆ˜ ์žˆ๋‹ค. (ํ•ด๋‹น ํŒจํ‚ค์ง€๊ฐ€ ํ”„๋กœ์ ํŠธ์— ์„ค์น˜๋˜์–ด ์žˆ์ง€ ์•Š์•„๋„ ๋ณผ ์ˆ˜ ์žˆ๋‹ค.)
  3. npm outdated: package.json์— ์žˆ๋Š” ๋ชจ๋“  ํŒจํ‚ค์ง€์˜ current version, required version, latest version์„ ๋ณผ ์ˆ˜ ์žˆ๋‹ค.

 

 

  1. npm v [package-name] versions: ํ•ด๋‹น ํŒจํ‚ค์ง€์˜ ๋ชจ๋“  version์„ ๋ณผ ์ˆ˜ ์žˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด npm v typescript versions๋ฅผ ์ž…๋ ฅํ•˜๋ฉด npm ํŽ˜์ด์ง€์˜ versions์—์„œ ๋ณผ ์ˆ˜ ์žˆ๋Š” ๋ฒ„์ „์„ ํ„ฐ๋ฏธ๋„์—์„œ ๋ณผ ์ˆ˜ ์žˆ๋‹ค.

 

 

  1. npm audit: dependencies์˜ ์ทจ์•ฝ์„ฑ์„ ํ™•์ธํ•˜๊ณ , ์ทจ์•ฝ์ ์ด ๋ฐœ๊ฒฌ๋˜๋ฉด ์ ์ ˆํ•œ ๋Œ€์•ˆ์„ ์•Œ๋ ค์ค€๋‹ค. ์ทจ์•ฝ์ ์ด ๋ฐœ๊ฒฌ๋˜์ง€ ์•Š์œผ๋ฉด 0 exit code๊ฐ€ ๋‚˜์˜จ๋‹ค. npm audit fix ํ˜น์€ npm audit fix -f๋กœ ์ทจ์•ฝ์ ์„ ์ˆ˜์ •ํ•  ์ˆ˜ ์žˆ๋‹ค.

 

 

  1. npm v [package-name]: ํ•ด๋‹น ํŒจํ‚ค์ง€์˜ ์ •๋ณด๋ฅผ ๋ณผ ์ˆ˜ ์žˆ๋‹ค.(dist, dependencies, maintainers, dist tags …)

 

๋ฐ˜์‘ํ˜•

๋Œ“๊ธ€