Skip to content

nelEcheverria01/watchman

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

watchman

watchman is a package that will reload its js file with every change you make.

It is worth mentioning that to carry out this project, the author was inspired by existing packages such as nodemon, restart etc...

JavaScript Style Guide License: MIT npm (scoped)

installation

to start using watchman, in your projects you can use:

npm i @nelson_echeverria/watchman --save-dev

or with shortcuts:

npm i @nelson_echeverria/watchman -D

behavior

watchman will observe the folder in which the file passed by parameter is located, ignoring everything outside of it.

usage

to implement watchman in your project, you can call watchman as a function and pass it the file name you want to monitor.

It would look something like this from src/index.js:

// ECMAScript modules
import watchman from '@nelson_echeverria/watchman'

if(process.env.NODE_ENV === 'developement'){
    watchman('./app.js')
}
// commonJS modules
const watchman = require('@nelson_echeverria/watchman').default

if(process.env.NODE_ENV === 'developement'){
    watchman('./app.js')
}

and look like this, into package.json:

{
    "scripts": {
        "start:dev": "NODE_ENV=development node ./app.js"
    }
}

example - wachman in action

watchman output

license

watchman was developed under the MIT license

About

watchman is a package that will reload its js file with every change you make

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published