Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
public:computer:typescript [2022/09/11 21:01] – alex | public:computer:typescript [2023/01/03 11:34] (current) – alex | ||
---|---|---|---|
Line 3: | Line 3: | ||
===== Quick Start ===== | ===== Quick Start ===== | ||
+ | * typescript 설치 <sxh bash> | ||
+ | $ npm i -g typescript | ||
+ | # or | ||
+ | $ npm i -D typescript | ||
- | <cli prompt=" | + | $ npm ls -g --depth=0 |
+ | $ tsc -v # global | ||
+ | $ npx tsc -v # local | ||
+ | </ | ||
+ | * prettier <sxh bash> | ||
+ | $ npm i tslint-config-prettier | ||
+ | </ | ||
+ | * set tslint.json <sxh json> | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | } | ||
+ | </ | ||
+ | * generate tsconfig.json <sxh json> | ||
+ | $ tsc --init | ||
+ | </ | ||
+ | * edit package.json for prettier <sxh json> | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | * install ts-node <sxh bash> | ||
+ | $ npm install -g ts-node | ||
+ | $ npm install --save-dev ts-node | ||
+ | </ | ||
+ | |||
+ | * 프로젝트 시작하기 | ||
$ npm init -y # create package.json in node.js project | $ npm init -y # create package.json in node.js project | ||
$ npm install typescript --save-dev | $ npm install typescript --save-dev | ||
Line 13: | Line 54: | ||
</ | </ | ||
- | <code json> | + | * package.json |
" | " | ||
" | " | ||
Line 21: | Line 62: | ||
</ | </ | ||
- | <cli prompt=" | + | * 실행 |
$ npm start | $ npm start | ||
</ | </ | ||
* [[https:// | * [[https:// | ||
- | * | + | * [[https:// |
+ | * [[https:// | ||
+ | |||
===== Setup ===== | ===== Setup ===== | ||
<cli> | <cli> | ||
Line 300: | Line 344: | ||
* [[https:// | * [[https:// | ||
* [[https:// | * [[https:// | ||
+ | * [[https:// |