LoginSignup
1
2

More than 3 years have passed since last update.

ts-node を使った TypeScript + node の環境構築

Posted at

Node.js + TypeScript の環境構築手順の備忘録です。

最小構成(最小ではない)

npm run startmain/app.tsを動かす。

package.json
{
  "dependencies": {
    "ts-node": "^8.4.1",
    "typescript": "^3.6.3"
  },
  "scripts": {
    "start": "ts-node main/app.ts"
  }
}
tsconfig.json
{
  "compilerOptions": {
    "target": "es6",
    "outDir": ".dist",
    "sourceMap": true,
    "module": "commonjs",
    "strict": true,
    "moduleResolution": "node",
    "removeComments": true,
    "emitDecoratorMetadata": true,
    "esModuleInterop": false,
    "experimentalDecorators": true,
    "forceConsistentCasingInFileNames": true
  }
}
1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2