nodemon.json

Overview

`nodemon.json` is a configuration file used to customize the behavior of [Nodemon](https://nodemon.io/), a utility that monitors changes in source files and automatically restarts the node application. This file defines specific settings such as which files to watch or ignore, file extensions to monitor, and the command to execute when a change is detected.

In this project, `nodemon.json` configures Nodemon to:

This setup streamlines the development workflow by automating build and restart processes whenever relevant source files are updated.


Configuration Properties

The file is a JSON object with the following key properties:

Property

Type

Description

ignore

`string[]`

List of file paths or patterns to be ignored by Nodemon. Changes to these files will not trigger a restart.

`watch`

`string[]`

List of file paths or patterns that Nodemon should monitor for changes. When any of these files change, Nodemon restarts the app.

`ext`

`string`

File extensions that Nodemon should watch for changes. In this case, `.ts` (TypeScript files).

`exec`

`string`

Command to execute when a watched file changes. Here, it runs a TypeScript build followed by starting the Node.js app.


Detailed Explanation of Each Property

1. ignore

2. watch

3. ext

4. exec


Usage Example

Assuming Nodemon is installed and configured to use this `nodemon.json` file, running:

nodemon

will:

This is ideal for development cycles involving TypeScript code where automatic rebuild and restart improve productivity.


Implementation Details


Interaction with Other System Parts


Visual Diagram

flowchart TD
    A[Nodemon] -->|Watches| B[tsconfig.tsbuildinfo files]
    A -->|Watches| C[src/*.ts files]
    A -->|Ignores| D[src/routes.ts]
    B --> E{File Change Detected?}
    C --> E
    E -->|Yes| F[yarn build]
    F --> G[node dist/polygon/api/src/app.js]
    E -->|No| A

**Diagram Explanation:**


Summary

The `nodemon.json` file is a minimal yet critical configuration that orchestrates automatic rebuilds and restarts of the Node.js application during development. It tailors Nodemon's file watching capabilities to the project's TypeScript environment and multi-package structure, enhancing developer efficiency by automating repetitive build and restart steps.


If you require further customization or integration, consider extending this file with additional options such as environment variables, delay times, or custom restart logic as supported by Nodemon.