Skip to content

Instantly share code, notes, and snippets.

@SimonMeskens
Last active April 22, 2019 09:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SimonMeskens/6947a84fe521428459787425d45bb5ac to your computer and use it in GitHub Desktop.
Save SimonMeskens/6947a84fe521428459787425d45bb5ac to your computer and use it in GitHub Desktop.
TypeScript Guides

Setting up TS for Node

tsconfig.json:

{
    "compilerOptions": {
        "module": "commonjs",
        "moduleResolution": "node",
        "target": **TARGET**,
        ...
    }
    ...
}

Install Node typings (change version to node environment): npm install --save-dev @types/node@^8.0.0

What should TARGET be?

According to the compatibility chart:

  • Node 7: es2016
  • Node 8: es2016
  • Node 9: es2017
  • Node 10: es2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment