Exciting release!Introducing "safe npm". Learn more
Socket
Log inDemoInstall

ergol

Package Overview
Dependencies
4
Maintainers
1
Versions
3
Issues
File Explorer

Advanced tools

ergol

Meant to run on top of another script during development, reload the app after every change in the codebase

    1.0.2latest
    GitHub

Version published
Maintainers
1
Weekly downloads
550
increased by29.41%

Weekly downloads

Changelog

Source

1.0.2

1.0.2 (2022-03-08)

Enhancements

Display a meaningful error message if the system does not have enough file watchers

Readme

Source

Ergol

For development purposes only

This script is meant to run on top of another process while watching source files. If any change occurs, it automatically shuts the process down, WAIT until it has correctly been stopped (or kills it after some delay), and only then restarts it.

This script is meant to replace solutions like nodemon, which have a few cumbersome caveats.

Usage

$ npx ergol <script> -c <config> -d <cwd>

OptionsAliasRequiredDescription
No flag needed-yesScript that runs under this process and that is reloaded when necessary
--config-cnoJSON file containing configuration variables intended to override default ones
--cwd-dnoCurrent Working Directory (if different from your actual cwd)
--script-args-noArguments to pass to the script
--node-args-noArguments to pass to the node interpreter
--watch-wnoArray of cwd relative path/to/directories or files to watch
--kill-delay-knoKill the process if it did not stop after this delay

Configuration

Ergol allows you to customize its behavior when necessary. If its a ponctual setting you can use one of the command argument listed before but we recommend using a config file when using recurrent options.

If you choose to use both methods, beware of which setting will be selected. Ergol will resolve each parameter by looking for command options first, config file then and default config otherwise.

Default Config

{ "killDelay": "5000", "nodeArgs": [], "scriptArgs": [], "watch": [ "lib", "src", "index.*s", "nodes_modules" ] }

Example

$ npx ergol scripts/start-app.js -c config/ergol.config.json --script-args=--option my-option-1

ergol.config.json

{ "killDelay": "10000", "watch": [ "index.ts", "src", "package-lock.json" ] }

Final Ergol Configuration

{ "killDelay": "10000", "nodeArgs": [], "scriptArgs": [ "--option my-option-1" ], "watch": [ "index.ts", "src", "package-lock.json" ] }

FAQs

Last updated on 08 Mar 2022

Did you know?

Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install Socket
Socket
support@socket.devSocket SOC 2 Logo

Product

  • Package Issues
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc