-
Notifications
You must be signed in to change notification settings - Fork 0
/
Readme.txt
48 lines (39 loc) · 1.04 KB
/
Readme.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
Step 1 : Install dependencies
npm install -D typescript
npm install -D tslint
npm install express -S
npm install @types/express -D
Step 2 : Create a file called tsconfig.json and put below code ,
{
"compilerOptions": {
"module": "commonjs",
"esModuleInterop": true,
"target": "es6",
"moduleResolution": "node",
"sourceMap": true,
"outDir": "dist"
},
"lib": ["es2015"]
}
Step 3 : Create a file called tslint.json and put below code,
{
"defaultSeverity": "error",
"extends": [
"tslint:recommended"
],
"jsRules": {},
"rules": {
"no-console":false
},
"rulesDirectory": []
}
Step 4 : Modify package.json file
"main": "dist/app.js",
"scripts": {
"start": "tsc && node dist/app.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
Step 5 : Create a src sub folder inside main folder and inside that create a file app.ts , and write below code,
console.log('ts');
Step 6 : run command npm start and you should see the output.
npm start