Initial Commit

main
Colloque Tsui 4 years ago
commit 75e6be37bb
  1. 3
      .babelrc
  2. 41
      .gitignore
  3. 30
      package.json
  4. 5
      src/index.ts
  5. 17
      tsconfig.json

@ -0,0 +1,3 @@
{
"presets": ["@babel/preset-env"]
}

41
.gitignore vendored

@ -0,0 +1,41 @@
lib-cov
*.seed
*.log
*.csv
*.dat
*.out
*.pid
*.gz
*.swp
pids
logs
results
tmp
# Build
public/css/main.css
# Coverage reports
coverage
# API keys and secrets
.env
# Dependency directory
node_modules
bower_components
# Editors
.idea
*.iml
# OS metadata
.DS_Store
Thumbs.db
# Ignore built ts files
dist/**/*
# ignore yarn.lock
yarn.lock

@ -0,0 +1,30 @@
{
"name": "typescript-nodejs-template",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "npm run serve",
"build": "npm run npm run build-ts && npm run lint",
"serve": "node dist/index.js",
"watch-node": "nodemon dist/index.js",
"watch": "concurrently -k -p \"[{name}]\" -n \"TypeScript,Node\" -c \"yellow.bold,cyan.bold,green.bold\" \"npm run watch-ts\" \"npm run watch-node\"",
"build-ts": "tsc",
"watch-ts": "tsc -w",
"lint": "tsc --noEmit && eslint \"**/*.{js,ts}\" --quiet --fix"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"typescript": "^3.7.3"
},
"devDependencies": {
"@babel/cli": "^7.7.5",
"@babel/core": "^7.7.5",
"@babel/preset-env": "^7.7.6",
"@types/concurrently": "^4.1.0",
"@types/node-fetch": "^2.5.4",
"concurrently": "^5.0.0"
}
}

@ -0,0 +1,5 @@
function init(firstName: string, lastName: string) {
return `${firstName} ${lastName}`;
}
console.log(init('Hello', 'world'));

@ -0,0 +1,17 @@
{
"compilerOptions": {
"module": "commonjs",
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"target": "es6",
"noImplicitAny": true,
"moduleResolution": "node",
"sourceMap": true,
"outDir": "dist",
"baseUrl": ".",
"paths": {
"*": ["node_modules/*", "src/types/*"]
}
},
"include": ["src/**/*"]
}
Loading…
Cancel
Save