Create repo on github with gitignore set to node
$ mkdir <path/foldername> && cd <path/foldername>
$ git init
$ git remote add origin https://github.com/biboyatienza/typescript-expressjs.git
$ git pull origin master
$ echo "# typescript-expressjs" >> README.md
$ npm init
$ git add .
$ git commit -m "first commit"
$ git push -u origin master
$ npm i -D typescript tslint
$ npm i express -S
$ npm i @types/express -D
$ code tsconfig.json
{
"compilerOptions": {
"module": "commonjs",
"esModuleInterop": true,
"target": "es6",
"moduleResolution": "node",
"sourceMap": true,
"outDir": "dist"
},
"lib": ["es2015"]
}
$ code tslint.json
{
"defaultSeverity": "error",
"extends": [
"tslint:recommended"
],
"jsRules": {},
"rules": {
"no-console":false
},
"rulesDirectory": []
}
$ code package.json
"main": "dist/app.js",
"scripts": {
"start": "tsc && node dist/app.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
$ mkdir scr && code app.ts
console.log('ts');
$ npm start
$ git add .
$ git commit -m "added npm packages and demo code"
$ git push -u origin master
$ mkdir <path/foldername> && cd <path/foldername>
$ git init
$ git remote add origin https://github.com/biboyatienza/typescript-expressjs.git
$ git pull origin master
$ echo "# typescript-expressjs" >> README.md
$ npm init
$ git add .
$ git commit -m "first commit"
$ git push -u origin master
$ npm i -D typescript tslint
$ npm i express -S
$ npm i @types/express -D
$ code tsconfig.json
{
"compilerOptions": {
"module": "commonjs",
"esModuleInterop": true,
"target": "es6",
"moduleResolution": "node",
"sourceMap": true,
"outDir": "dist"
},
"lib": ["es2015"]
}
$ code tslint.json
{
"defaultSeverity": "error",
"extends": [
"tslint:recommended"
],
"jsRules": {},
"rules": {
"no-console":false
},
"rulesDirectory": []
}
$ code package.json
"main": "dist/app.js",
"scripts": {
"start": "tsc && node dist/app.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
$ mkdir scr && code app.ts
console.log('ts');
$ npm start
$ git add .
$ git commit -m "added npm packages and demo code"
$ git push -u origin master
Comments
Post a Comment