this repository is for typescript beginners.
you can start typescript soon with this repository. :))
this repository is assumed to work in such environment as below.
> node -v
v14.5.0
> npm -v
6.14.5
> yarn -v
1.22.4
you should run this command at first.
this command means you are going to install the required packages into your working directory.
yarn install
there are some reserved npm-scripts
.
npm-scripts
is in the script
section in package.json
"scripts": {
"build": "yarn clean && yarn compile",
"clean": "rimraf dist",
"compile": "tsc",
"dev": "ts-node src/index.ts",
"format": "eslint --fix 'src/**/*.ts'",
"start": "node dist/index.js",
"update": "ncu -u && yarn install && yarn upgrade",
"watch": "ts-node-dev --respawn src/index.ts"
},
start js program. the entry point is dist/index.js
.
you have to translate
ts
files into js
files at first.
(this translation
is called transpile
.)
transpile src/*.ts
files into dist/*.js
files.
start ts
program without transpiling. the entry point is src/index.ts
.
start ts
program without transpiling.
once the src/*.ts
codes are changed, the running program will immediately automatically restart.
remove dist/*.js
files.
automatically remove dist/*.js
and transpile src/*.ts
.