๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๐Ÿ’ฌ/ใ…ใ……ใ…Œใ…‹ใ…ใ…… ์ฑŒ๋ฆฐ์ง€

ํŒจ์ŠคํŠธ์บ ํผ์Šค ์ฑŒ๋ฆฐ์ง€ 17์ผ์ฐจ

๐Ÿงš‍โ™€๏ธ

17์ผ์ฐจ

 

Part 3. JavaScript Essentials

Ch 1. Node.js

 


 

Ch 1. Node.js

 

 

์ฃผ์ œ

 

  • Node.js
  • npm

 

 

์ฃผ์š” ๋‚ด์šฉ

 

  • JS๋Š” ์ปดํ“จํ„ฐ ํ™˜๊ฒฝ(Node.js)์—์„œ๋„ ๋™์ž‘ํ•˜๊ณ , ๋ธŒ๋ผ์šฐ์ €(Chrome)์—์„œ๋„ ๋™์ž‘ํ•œ๋‹ค.

 

 ๐Ÿ”— npm (Node Package Manager) 

  • node_modules: npm ์„ค์น˜ ํŒจํ‚ค์ง€๋“ค์ด ๋‹ด๊ฒจ ์žˆ๋Š” ๊ณณ
  • package-lock.json: ์ž๋™์œผ๋กœ ํŒจํ‚ค์ง€ ๊ด€๋ฆฌ
  • package.json: ์šฐ๋ฆฌ๊ฐ€ ์ง์ ‘์ ์œผ๋กœ ํŒจํ‚ค์ง€ ๊ด€๋ฆฌ

 

 

"devDependencies": {
    "parcel-bundler": "^1.12.5"
  },
  "dependencies": {
    "lodash": "^4.17.21"
  }

 

 

# ๊ฐœ๋ฐœ์šฉ ์˜์กด์„ฑ ํŒจํ‚ค์ง€ ์„ค์น˜ (๊ฐœ๋ฐœํ•  ๋•Œ๋งŒ ํ•„์š”ํ•˜๊ณ , ์‹ค์ œ๋กœ ๋™์ž‘ํ•  ๋•Œ๋Š” ํ•„์š”ํ•˜์ง€ ์•Š๋Š” ํŒจํ‚ค์ง€)
$ npm install -D XXX

$ npm install parcel-bundler -D

 

// package.json

"scripts": {
    "dev": "parcel index.html",
    "build": "parcel build index.html"
  },

 

# ๊ฐœ๋ฐœ์šฉ ์„œ๋ฒ„ ์‹คํ–‰
$ npm run dev

# ์‚ฌ์šฉ์ž๋“ค์ด ๋ณด๋Š” ์šฉ๋„์˜ ๊ฒฐ๊ณผ ์ถœ๋ ฅ (๋‚œ๋…ํ™”)
$ npm run build

 

 

# ์ผ๋ฐ˜ ์˜์กด์„ฑ ์„ค์น˜ (์‹ค์ œ๋กœ ๋™์ž‘ํ•  ๋•Œ๋„ ํ•„์š”ํ•œ ํŒจํ‚ค์ง€)
$ npm install XXX

$ npm install lodash

 

import _ from "lodash";

console.log("hello world");
console.log(_.camelCase("hello world"));

 

_.camelCase()

 

 ๐Ÿ”— ์œ ์˜์  ๋ฒ„์ „ (SemVer) 

^Major.Minor.Patch

  • Major: ๊ธฐ์กด ๋ฒ„์ „๊ณผ ํ˜ธํ™˜๋˜์ง€ ์•Š๋Š” ์ƒˆ๋กœ์šด ๋ฒ„์ „
  • Minor: ๊ธฐ์กด ๋ฒ„์ „๊ณผ ํ˜ธํ™˜๋˜๋Š” ์ƒˆ๋กœ์šด ๊ธฐ๋Šฅ์ด ์ถ”๊ฐ€๋œ ๋ฒ„์ „
  • Patch: ๊ธฐ์กด ๋ฒ„์ „๊ณผ ํ˜ธํ™˜๋˜๋Š” ๋ฒ„๊ทธ ๋ฐ ์˜คํƒ€ ๋“ฑ์ด ์ˆ˜์ •๋œ ๋ฒ„์ „
  • ^: Major ๋ฒ„์ „ ์•ˆ์—์„œ ๊ฐ€์žฅ ์ตœ์‹  ๋ฒ„์ „์œผ๋กœ ์—…๋ฐ์ดํŠธ ๊ฐ€๋Šฅ

 

 ๐Ÿ”— .gitignore : NPM ํ”„๋กœ์ ํŠธ์˜ ๋ฒ„์ „ ๊ด€๋ฆฌ

 

.cache/
dist/
node_modules/

 

 

 

์ƒˆ๋กญ๊ฒŒ ์•Œ๊ฒŒ ๋œ ๋‚ด์šฉ

 

 ๐Ÿ”— NVM (Node Version Manager) 

https://github.com/coreybutler/nvm-windows

 

GitHub - coreybutler/nvm-windows: A node.js version management utility for Windows. Ironically written in Go.

A node.js version management utility for Windows. Ironically written in Go. - GitHub - coreybutler/nvm-windows: A node.js version management utility for Windows. Ironically written in Go.

github.com

 

 

๋Š๋‚€์ 

 

 ๋“œ๋””์–ด JS!!! ๊บ„๋ฅด๋ฅต๐Ÿงš‍โ™€๏ธ ํ‰์†Œ์— ํ”„๋กœ์ ํŠธํ•  ๋•Œ $ npm i ๋กœ ๊ทธ๋ƒฅ ์„ค์น˜ํ•ด์„œ ์‚ฌ์šฉํ–ˆ์—ˆ๋Š”๋ฐ... package.json๊ณผ package-lock.json์˜ ์ฐจ์ด, ๊ฐœ๋ฐœ์ž์šฉ๊ณผ ์‚ฌ์šฉ์ž์šฉ ์„œ๋ฒ„์˜ ์ฐจ์ด๊นŒ์ง€.. ๋ฌด์‹ฌ์ฝ” ์ง€๋‚˜๊ฐ”๋˜ ๊ฒƒ๋“ค์— ๋Œ€ํ•ด ์ž์„ธํžˆ ๋ฐฐ์šธ ์ˆ˜ ์žˆ์—ˆ๋˜ ๊ฐ•์˜์˜€๋‹ค. ๊ทธ๋ฆฌ๊ณ  ๋ฒ„์ „์˜ ์ค‘์š”์„ฑ์— ๋Œ€ํ•ด์„œ๋„ ์•Œ ์ˆ˜ ์žˆ๋Š” ์‹œ๊ฐ„์ด์—ˆ๋‹ค.

 


 

๋ณธ ํฌ์ŠคํŒ…์€ ํŒจ์ŠคํŠธ์บ ํผ์Šค ํ™˜๊ธ‰ ์ฑŒ๋ฆฐ์ง€ ์ฐธ์—ฌ๋ฅผ ์œ„ํ•ด ์ž‘์„ฑ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

 

#ํŒจ์ŠคํŠธ์บ ํผ์Šค

#ํŒจ์บ ์ฑŒ๋ฆฐ์ง€

#์ง์žฅ์ธ์ธ๊ฐ•

#์ง์žฅ์ธ์ž๊ธฐ๊ณ„๋ฐœ

#ํŒจ์ŠคํŠธ์บ ํผ์Šคํ›„๊ธฐ

#ํ•œ_๋ฒˆ์—_๋๋‚ด๋Š”_ํ”„๋ก ํŠธ์—”๋“œ_๊ฐœ๋ฐœ_์ดˆ๊ฒฉ์ฐจ_ํŒจํ‚ค์ง€_Online

 

https://bit.ly/37BpXiC

 

ํŒจ์ŠคํŠธ์บ ํผ์Šค [์ง์žฅ์ธ ์‹ค๋ฌด๊ต์œก]

ํ”„๋กœ๊ทธ๋ž˜๋ฐ, ์˜์ƒํŽธ์ง‘, UX/UI, ๋งˆ์ผ€ํŒ…, ๋ฐ์ดํ„ฐ ๋ถ„์„, ์—‘์…€๊ฐ•์˜, The RED, ๊ตญ๋น„์ง€์›, ๊ธฐ์—…๊ต์œก, ์„œ๋น„์Šค ์ œ๊ณต.

fastcampus.co.kr