gypwatcher

Automatically run node-gyp when your module's C++ files change

Usage no npm install needed!

<script type="module">
  import gypwatcher from 'https://cdn.skypack.dev/gypwatcher';
</script>

README

gypwatcher

Automatically run node-gyp when your module's C++ files change

Install

npm install -g gypwatcher

Usage

Run gypwatcher in your project directory to run node-gyp when your project's C++ files change.

API

Gypwatcher will look for a config file ./gypwatcher in your project to load following settings which may be customized. The example below is default.

{
    watchFiles: [
        './**/*.cc',
        './**/*.h',
        './**/*.cpp',
        './**/*.cxx',
        './**/*.c'
    ],
    chokidarOptions: {
        ignoreInitial: false
    },
    nodeGypScript: [
        '/usr/local/bin/node-gyp',
        '/usr/local/lib/node_modules/node-gyp/bin/node-gyp.js'
    ],
    nodeGypOptions: [
        'rebuild'
    ],
    nodeGypPost: './postExec'
};