본문 바로가기

Node

npm, install, uninstall, let, const, var

노드의 기본을 몇가지 알아보자.

 

npm이 기본적으로 같이 깔린다.

버전을 확인하고 싶으면 

npm -v로 버전을 확인하자.

 

npm은 사이트에 가서 검색하면 나온다.

https://www.npmjs.com/

 

npm | Home

Bring the best of open source to you, your team, and your company Relied upon by more than 17 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

 

여기에 figlet을 깔고 테스트해보자

 

npm install figlet

이걸 하면 figlet이 깔린다.

이렇게 결과가 잘 나온다.

 

지우고 싶다면

npm uninstall figlet으로 삭제할 수 있다.

 

npm install -g figlet-cli

이 명령을 치면 내 컴퓨터에 있는 모든 프로젝트에 figlet이 반영된다.

사용은 비추한다.

 

 

if (true){
    var a1 = 10;
    const a2 = 3;
    let a3 = 15;

    //a2 = 5;   const는 값을 변경 불가
    a3 = 13;     // let은 값 변경 가능

    console.log(`${a1} + ${a2} = ${a3}`)
}


console.log(a1);
//console.log(a2);   cost와 let은 괄호 밖을 벗어나면 사용이 불가능하다.
//console.log(a3);

 

const, let, var의 차이를 알아두자

'Node' 카테고리의 다른 글

javascript 함수 4가지  (0) 2024.07.28
express generator  (0) 2024.07.28
docker, mariaDB 설치 및 사용  (0) 2024.07.22
html, css, js 간단히 만들고 node에 연결해보기  (0) 2024.07.21
JS 기초 - var, let const  (0) 2024.06.18