npm install typescript @types/node --save-dev
tsc --init
{
"compilerOptions": {
"target": "es5",
"lib": ["es2015"],
"rootDir": "src",
"outDir": "dist",
"module": "commonjs",
"moduleResolution": "node",
"strict": true,
"declaration": true,
"sourceMap": true,
"inlineSources": true,
"types": ["node", "mocha"]
},
"include": ["src/**/*"]
}
{
"scripts": {
"build": "tsc"
},
"devDependencies": {
"@types/node": "^10.12.11",
"typescript": "^3.2.1"
}
}
{
"scripts": {
"test": "mocha dist/**/*.spec.js -R spec --bail"
}
"devDependencies": {
"@types/mocha": "^5.2.5",
"mocha": "^5.2.0",
}
}