π― npm package μ€μΉ λ° μ¬μ©λ²π―
npmμΌλ‘ λ€λ₯Έ μ¬λλ€μ΄ λ§λ€μ΄ λ ν¨ν€μ§ μ€μΉ λ° μ¬μ©
NPM (Node Package Manager)
- μ€ν μμ€ κ°λ°μλ€μ΄ λ§λ 80λ§κ°μ μ½λ ν¨ν€μ§κ° ν¬ν¨λμ΄μλ€.
- μννΈμ¨μ΄ 곡μ λ₯Ό μν΄ npmμ μ¬μ©νλ€.
- λͺ¨λ npm ν¨ν€μ§λ package.jsonμ΄λΌλ νμΌλ‘ μ μλλ€.
- node.js μ€μΉκ° μ°μ μ μΌλ‘ μ΄λ€μ ΈμΌνλ€.
package.json μμ±
νλ‘μ νΈμ λν κ°λ¨ν μ€λͺ μ΄ λ΄κΈ°λ package.json νμΌμ μ μνλ€.
- (1) npm init : κ°κ° μ΅μ λ€μ μ§μ μμ±νλ€.
- (2) npm init -y : λͺ¨λ μ΅μ μ΄ yes
(1) κ³Όμ μ΄ λ²κ±°λ‘λ€κ³ λκ»΄μ§λ€λ©΄
npm init -yλͺ λ Ήμ΄λ‘ package.json νμΌμ λ§λ€μ΄ μ£Όλ©΄ λλ€.
express / uuid4 μΉ νλ μμν¬ λ€μ΄λ‘λ
1οΈβ£ npm install <ν¨ν€μ§λͺ >
2οΈβ£ λͺ λ Ήμ΄λ₯Ό μμ±νλ©΄ node_modules ν΄λκ° μμ±λλ€.
π npm 곡μ μ¬μ΄νΈ
npm
Bring the best of open source to you, your team, and your company Relied upon by more than 11 million developers worldwide, npm is committed to making JavaScript development elegant, productive, and safe. The free npm Registry has become the center of Java
www.npmjs.com
π uuid4 package
https://www.npmjs.com/package/uuid4
uuid4
Node UUID v4 Generator. Latest version: 2.0.2, last published: 2 years ago. Start using uuid4 in your project by running `npm i uuid4`. There are 175 other projects in the npm registry using uuid4.
www.npmjs.com
: npm 곡μ μ¬μ΄νΈμμ ν¨ν€μ§λͺ μ κ²μν΄μ μ€μΉ λ° μ¬μ© λ°©λ²μ μ΅ν μ μλ€.
uuid4 ν¨ν€μ§ μ¬μ©νκΈ°
1 2 3 | // uniqueν ν€λ₯Ό μ°λ uuid4 package const uuid4 = require('uuid4'); console.log((uuid4())); | cs |
- require μμ½μ΄ : JSμμ ν¨ν€μ§λ λͺ¨λμ μ°Έμ‘°ν λ μ¬μ©
'λͺ¨λμ κ°μ Έμμ μ¬μ©νλ€.'
- require('uuid4') : κ²½λ‘λ₯Ό μ§μ νμ§ μλλ€.
: λ΄κ° λ§λ κ²μ .μ μ°μ΄κ°λ©° μ£Όμλ₯Ό μ°Ύμκ°μΌνμ§λ§
λ¨μ΄ λ§λ λ΄μ₯ λͺ¨λ κ°μ κ²λ€μ κ²½λ‘λ₯Ό μ§μ νμ§ μμλ λλ€.
node_modules ν΄λκ° μ‘΄μ¬νκΈ° λλ¬Έμ λ³μμ²λΌ λΆλ¬μ μ¬μ©ν μ μλ€.
'Second Brain > Node' μΉ΄ν κ³ λ¦¬μ λ€λ₯Έ κΈ
[Node] express μΉ νλ μμν¬ - μΉ μλ² λμ°κΈ° (0) | 2022.05.29 |
---|---|
λͺ¨λ ν¨ν΄ (0) | 2022.05.25 |
npm install λͺ λ Ήμ΄μ node_modules ν΄λ (0) | 2022.05.23 |
Node μ€ν (0) | 2022.05.22 |
[Node] node λ²μ κ΄λ¦¬ tj/n μλμ° μ€μΉ λΆκ° (0) | 2022.04.07 |
λκΈ