1.1.12 • Published 9 months ago

node-swatcher v1.1.12

Weekly downloads
-
License
ISC
Repository
-
Last release
9 months ago

node-swatcher

node-swatcher is a lightweight file-watching tool, designed to automatically restart or reload file/script when the specified file changes. This tool is ideal if you want a simple file sandbox where you want to save time by not manually re-executing your file every time you make a change.

Features

  • Watches specified file for changes.
  • Automatically restarts the application on file update.
  • Has a cool json based config feature.

Installation

  • npm i node-swatcher or npm install node-swatcher
  • yarn add node-swatcher
  • Add required script to your package.json Alt Text

Usage

-Using Config File

  1. Create a swatcher.json file in the same directory as file to be run.
  2. Add the configurations as specified :
{
  "serverRestartMessage": "The Server has been restarted",
  "serverErrorMessage": "Try Fixing the error and then , retry",
  "fileChangeMessage": "File has been changed!",
  "filePath": "./demoFile.js",
  "command": "node"
}

Here command refers to the program to be used for running the file specified in the filePath.

  1. Run the command:
  • npm run swatch or yarn swatch

-Using CLI

  • First argument requied is the file path.

  • For running the node-swatcher using CLI we can pass the CLI equivalents of our json config as named args in the command.

For Example :

npm run swatch <filepath> --com=node
  • Remember --com is a required named argument.

Customizations

  • You can customize the restart,error and file change messages as required
1.1.9

9 months ago

1.1.8

9 months ago

1.1.7

9 months ago

1.1.12

9 months ago

1.1.11

9 months ago

1.1.10

9 months ago

1.1.6

9 months ago

1.1.5

9 months ago

1.1.4

9 months ago

1.1.3

9 months ago

1.1.2

9 months ago

1.1.1

9 months ago

1.1.0

9 months ago

1.0.9

9 months ago

1.0.8

9 months ago

1.0.7

9 months ago

1.0.6

9 months ago

1.0.5

9 months ago

1.0.4

9 months ago

1.0.3

9 months ago

1.0.2

9 months ago

1.0.1

9 months ago

1.0.0

9 months ago