Last active
August 20, 2019 08:02
-
-
Save FedericoPonzi/519df99c80458e0d536b7882db1d68e5 to your computer and use it in GitHub Desktop.
Setup typescript project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#from: https://basarat.gitbooks.io/typescript/docs/quick/nodejs.html | |
npm init -y | |
npm install typescript --save-dev | |
npm install @types/node --save-dev | |
npx tsc --init --rootDir src --outDir lib --esModuleInterop --resolveJsonModule --lib es6,dom --module commonjs | |
# Done! use `code .` to fireup visual studio. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm install ts-node --save-dev | |
npm install nodemon --save-dev | |
"scripts": { | |
"start": "npm run build:live", | |
"build": "tsc -p .", | |
"build:live": "nodemon --watch 'src/**/*.ts' --exec 'ts-node' src/index.ts" | |
}, | |
# npm start and as you edit index.ts it's reloaded. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment