03. 데이터 타입, tsc watch - seongjunhwang/clone_blockchain GitHub Wiki
인자 타입 설정
함수 타입 설정
const sayHi = (name: string, age: number, gender: string): string => {
return (`hello ${name}, you are ${age}, you are ${gender}`)
};
서버 자동 재시작
- TSC Watch 설치
- package.json 파일 수정
"scripts": {
"start": "tsc-watch --onSuccess \" node dist/index.js\" "
},
{
"compilerOptions": {
"module": "commonjs",
"target": "ES2015",
"sourceMap": true,
"outDir": "dist"
},
"include": ["src/**/*"],
"exclude": ["node_modules"]
}
- src폴더에 ts파일, dist폴더에 js파일 생성되도록 세팅