Skip to content

Instantly share code, notes, and snippets.

@jackinf
Created July 17, 2019 12:22
Show Gist options
  • Save jackinf/6e74c418b3a8b1668ea913914329aace to your computer and use it in GitHub Desktop.
Save jackinf/6e74c418b3a8b1668ea913914329aace to your computer and use it in GitHub Desktop.
How to start Node.js app with Typescript and Nodemon

How to start Node.js app with Typescript and Nodemon

Install dependencies

npm i -S nodemon ts-node typescript

Copy the nodemon.json configuration file

{
  "restartable": "rs",
  "ignore": [
    ".git",
    "./**/*.spec.ts",
    "node_modules"
  ],
  "verbose": true,
  "exec": "ts-node ./index.ts",
  "watch": [
    "."
  ],
  "env": {
    "NODE_ENV": "development"
  },
  "ext": "ts"
}

Update package.json to have this script:

"start": "nodemon --config nodemon.json",

Create an index.ts file and that'd be the entry point into your application

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment