@nelson_echeverria/watchman

1.1.0 • Public • Published

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

/@nelson_echeverria/watchman/

    Package Sidebar

    Install

    npm i @nelson_echeverria/watchman

    Weekly Downloads

    7

    Version

    1.1.0

    License

    MIT

    Unpacked Size

    28.3 kB

    Total Files

    15

    Last publish

    Collaborators

    • nelson_echeverria