New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

electron-watch

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

electron-watch

Monitor file change, and restart Electron app use command.

latest
Source
npmnpm
Version
1.0.9
Version published
Maintainers
1
Created
Source

electron-watch

Automatically restart Electron app when the main process file is changed.

npm MIT License

Installation

npm install electron-watch

Usage

For example,

package.json:

{
  //...
  "scripts": {
    "dev:electron-main": "cross-env NODE_ENV='development' electron -r babel-register ./app/renderer/",
  },
  //...
}

Adding code block to the main process file:

index.js:

import electron from 'electron';
import path from 'path';

if (process.env.NODE_ENV === 'development') {
  require('electron-watch')(
    __dirname,
    'dev:electron-main',             // npm scripts, means: npm run dev:electron-main
    path.join(__dirname, './'),      // cwd
    2000,                            // debounce delay
  );
}

OPTIONS

fieldtypedescription
pathstringPaths to files, dirs to be watched recursively, or glob patterns.
commandstringnpm script name, use this to start electron main process
cwdstringCurrent working directory of the child process.
delayNumberDelay (in ms) arguments of debounce, default is 3000ms

LICENSE

MIT @ Alchemy

Keywords

electron

FAQs

Package last updated on 22 Jun 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts