npm install -g express-generator express myExpressApp cd myExpressApp npm install above sea level start
http://localhost:3000
Add TypeScript support in the current NodeJs project
2. Add tsconfig.json to configure the compilation output of TypeScript
{ "compilerOptions": { "target": "es5", "module": "commonjs", "watch": false, "sourceMap": true, "outDir": "./out" }, "exclude": [ "node_modules", "out" ] }
3. Add tasks.json, add compile commands and tasks
{ // See https://go.microsoft.com/fwlink/?LinkId=733558 // for the documentation about the tasks.json format "version": "0.1.0", "command": "tsc", "isShellCommand": true, "args": ["-p", "."], "showOutput": "always", "problemMatcher": "$tsc" }
4. Write TS code in app.js
var http=require('http'); console.info(http);