Nodejs Tutorial 노드js 시작하기
(nodejs 설치)
https://nodejs.org/en/
.LTS 장기적 지원 버전 -> 개발, 배포에 사용
.장기적 지원x 최신 기능 사용 가능 -> 최신 기능 사전 학습
nodejs, npm 설치확인
node -v
npm -v
(개발툴 설치)
https://code.visualstudio.com/
EXTENSIONS(확장 모듈) 설치
.StandardJS - JavaScript Standard Style
.ES7 React/Redux/GraphQL/React-Native snippets
(Node.js핵심개념)
- I/O : Input Output
- 비동기 동기
- Non-blocking blocking
(npm, npx)
REPL - 커멘트(cmd) Node 실행
npm - 패키지 관리자
npx - 일회성 사용 목적
npm 명령어
현재 프로젝트에 express 설치
npm install express
npm i express
패키지 삭제
npm uninstall express
--save-dev 옵션, 패키지 설치 후 package-json 안에 기재 후 자동 설치
npm install express --save-dev
전역 환경 설치
npm install nodemon -global
npm 패키지 초기화
npm init nodejs-app
npm 패키지 설치 목적 명령어
npx create-react-app react-app
npx 테스트
npx cowsay "hello"
(nodemon)
파일에 변화가 생기면 nodemon이 변화를 감지하여 재실행
(nodemon 설치)
npm install nodemon -global
맥의 경우 권한 오류가 난다면
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
*맥 권한 오류 시 실행 명령어
sudo chown -R $USER /usr/local/lib/node_modules
nodemon 실행
nodemon first.js
자바스크립트 작동 순서 이해 사이트
유용 메서드
.every - 배열의 여러 조건 and 검증
.sum - 배열의 여러 조건 or 검증
.find - 배열의 특정 값 반환
.includes - 배열의 특정 값 존애 여부 반환
.forEach - 비동기 처리 안됨
.object.assign - 객체 병합
'...' 카테고리의 다른 글
맥북 초기화 오류 작업을 완료할 수 없습니다.(pkdownloaderror 오류 8.) (0) | 2020.06.06 |
---|---|
소스트리(SourceTree) fatal: Authentication failed for 에러 대처법 (0) | 2020.05.23 |
Tailwindcss Setup (0) | 2020.04.07 |
Java - 두 좌표간 거리, 방위각 구하기 + 좌표 이동 (0) | 2020.01.02 |