Node+TypeScript

npm install -g typescript
npm install --save-dev typescript
npm install --save-dev lodash @types/lodash
npm install @types/node --save-dev
 tsconfig.json 
{
    "compilerOptions":
    {
        "module": "commonjs",
        "target": "es2015",
        "noImplicitAny": false,
        "strictNullChecks": true,
        "strict": true,
        "alwaysStrict": true,
        "sourceMap": false,
        "noImplicitReturns": true,
        "noImplicitThis": true,
        "pretty": true,

        "listFiles": true,
        "listEmittedFiles": true,
        "lib": [
            "es2016"
        ],
        "typeRoots": [
            "./node_modules/@types"
        ]
    },
    "include": [
        "./**/*"
    ],
    "exclude": [
        "node_modules",
        "**/*.spec.ts",
        "*.js"
    ]
}
import * as path from 'path';                     // 测试能否正常使用 Node 的内置模块
import express from 'express'

export class NodeModuleTester {
  public static readonly STATIC_VAR = 'STATIC';   // 测试static变量
  public name:string
  public age:number
  public app:any

  constructor(                                    // 测试构造方法
    private readonly f1: string,
    private readonly f2: number) {
  	this.app = express()
  	this.name = f1
  	this.age = f2
  }

  public static testPath() {                      // 测试静态方法
    const curdir = './';
    console.log(path.resolve(curdir))
    return path.resolve(curdir);
  }
}
import {NodeModuleTester} from './utils';

function main() {
  const tester = new NodeModuleTester("s1", 12);

  console.log(NodeModuleTester.STATIC_VAR);

  console.log(NodeModuleTester.testPath());

  console.log(tester.name, tester.age)
}

main()
tsc && node main.js