Node.js
Chrome’s
V8 JavaScript Engine
을 사용하여, JavaScript 를
해석하고 OS 레벨에서의 API 를
제공하는 서버사이드용 JavaScript
Run Time 환경
Browser
HTML 을 동적으로 만들기 위해
Browser 에서 JavaScript 를 해석
하고, DOM 을 제어할 수 있도록 하는
JavaScript Run Time 환경
node.js 설치
TypeScript Compiler 설치
- npm *
- npm i typescript -g
- node_modules/.bin/tsc
- tsc source.ts
- Visual Studio plugin
- Visual Studio 2017 / 2015 Update3 이후로는 기본으로 설치
- 없다면 설치
간단한 컴파일러 사용 예제
- TypeScript Compiler 를 글로벌로 설치 후,
- CLI 로 File Compile
- 특정 프로젝트 폴더에서 TypeScript Compiler 설정에 맞춰 Compile
- 특정 프로젝트 폴더에서 TypeScript Compiler 설정에 맞춰 Compile(Watch 모드)
- 프로젝트에 TypeScript Compiler 를 설치 후,
- .bin 안의 명령어로 File Compile
- npm script 로 File Compile
- 프로젝트에 있는 TypeScript 설정에 맞춰, npm script 로 Compile
- 프로젝트에 있는 TypeScript 설정에 맞춰, npm script 로 Compile(Watch 모드)
mkdir tsc-project
npm init -y
npm i typescript
cat package.json
ls
ls node_modules
ls -al node_modules
ls -al node_modules/.bin
npx tsc —init
ls (tsconfig.json 생성)
nano test.ts
npx tsc
ls (test.js 생성)
nano package.json
(”scripts” : { “build” : “tsc” } 로 수정)
npm run build
npm run build:watch