nodemon.json


Overview

The [nodemon.json](/projects/291/68849) file is a configuration file used by **nodemon**, a utility that monitors changes in source code files and automatically restarts the Node.js application when changes are detected. This configuration customizes the behavior of nodemon specifically for a TypeScript-based Node.js project, streamlining the development workflow by automating rebuild and restart processes.

In this particular setup, [nodemon.json](/projects/291/68849) specifies which files and directories to watch or ignore, the file extensions to monitor, and the exact command to execute when a restart is triggered. This ensures efficient development iterations by rebuilding the project and launching the application automatically upon relevant source changes.


Configuration Properties

The JSON object in the file contains four key properties:

{
  "ignore": [...],
  "watch": [...],
  "ext": "...",
  "exec": "..."
}

1. ignore

2. watch

3. ext

4. exec


Implementation Details


Interaction with Other Parts of the System


Usage Example

When a developer modifies a `.ts` file in `src` or updates a package's build info file:

  1. Nodemon detects the change.

  2. Runs yarn build to compile the TypeScript project.

  3. If the build succeeds, nodemon runs node dist/dogecoin/api/src/app.js to start the latest app version.

  4. If the build fails, nodemon does not restart, allowing the developer to fix errors.


Mermaid Flowchart Diagram

This flowchart illustrates the workflow triggered by nodemon configuration in this file:

flowchart TD
    A[File Change Detected]
    B{Is changed file in "ignore"?}
    C{Is changed file in "watch" with extension .ts?}
    D[Run "yarn build"]
    E{Build successful?}
    F[Run "node dist/dogecoin/api/src/app.js"]
    G[No action]

    A --> B
    B -- Yes --> G
    B -- No --> C
    C -- No --> G
    C -- Yes --> D
    D --> E
    E -- Yes --> F
    E -- No --> G

Summary