Skip to content

Instantly share code, notes, and snippets.

@catdad
Last active August 2, 2019 04:45
Show Gist options
  • Save catdad/d7f0bff7b47d0796f994174aa078719c to your computer and use it in GitHub Desktop.
Save catdad/d7f0bff7b47d0796f994174aa078719c to your computer and use it in GitHub Desktop.
const path = require('path');
const chokidar = require('chokidar');
const root = path.resolve('.');
const watcher = chokidar.watch('.', {
cwd: root,
ignored: [
/(^|[/\\])\../, // Dotfiles
'node_modules',
'**/*.map'
]
});
watcher.on('add', f => console.log('add', f));
watcher.on('ready', () => console.log('ready'));
{
"name": "gist",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"chokidar": "^3.0.2",
"electron": "^4.2.8"
}
}
const { spawn } = require('child_process');
spawn('node', ['debug.js'], { stdio: 'inherit' });
spawn('npx', ['electron', '--version'], { stdio: 'inherit' });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment