{"id":19215208,"url":"https://github.com/iceend/electron-watch","last_synced_at":"2025-09-24T00:26:10.319Z","repository":{"id":54928789,"uuid":"118998974","full_name":"IceEnd/electron-watch","owner":"IceEnd","description":"Automatically restart Electron app when the main process files are changed.","archived":false,"fork":false,"pushed_at":"2021-01-13T02:07:17.000Z","size":14,"stargazers_count":9,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-14T13:41:08.755Z","etag":null,"topics":["auto-reload","electron","electron-watch"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/IceEnd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-26T03:10:06.000Z","updated_at":"2023-10-16T11:50:20.000Z","dependencies_parsed_at":"2022-08-14T06:50:31.146Z","dependency_job_id":null,"html_url":"https://github.com/IceEnd/electron-watch","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IceEnd%2Felectron-watch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IceEnd%2Felectron-watch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IceEnd%2Felectron-watch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IceEnd%2Felectron-watch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IceEnd","download_url":"https://codeload.github.com/IceEnd/electron-watch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249951429,"owners_count":21350459,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["auto-reload","electron","electron-watch"],"created_at":"2024-11-09T14:13:00.456Z","updated_at":"2025-09-24T00:26:05.230Z","avatar_url":"https://github.com/IceEnd.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# electron-watch\n\n\u003e Automatically restart Electron app when the main process file is changed.\n\n[![npm](https://img.shields.io/npm/v/electron-watch.svg)](https://www.npmjs.com/package/electron-watch)\n[![MIT License](https://img.shields.io/github/license/IceEnd/electron-watch.svg)](https://github.com/IceEnd/electron-watch/blob/master/LICENSE)\n\n# Installation\n\n```shell\nnpm install electron-watch\n```\n\n# Usage\n\nFor example,\n\n`package.json`:\n\n```js\n{\n  //...\n  \"scripts\": {\n    \"dev:electron-main\": \"cross-env NODE_ENV='development' electron -r babel-register ./app/renderer/\",\n  },\n  //...\n}\n\n```\nAdding code block to the main process file:\n\n`index.js`:\n\n```js\nimport electron from 'electron';\nimport path from 'path';\n\nif (process.env.NODE_ENV === 'development') {\n  require('electron-watch')(\n    __dirname,\n    'dev:electron-main',             // npm scripts, means: npm run dev:electron-main\n    path.join(__dirname, './'),      // cwd\n    2000,                            // debounce delay\n  );\n}\n```\n\n# OPTIONS\n\n|field      |type                |description                                                      |\n|-----      |----                |----                                                             |\n|path       |string              |Paths to files, dirs to be watched recursively, or glob patterns.|\n|command    |string              |`npm script` name, use this to start electron main process       |\n|cwd        |string              |Current working directory of the child process.                  |\n|delay       |Number              |Delay (in ms) arguments of debounce, default is 3000ms            |\n# LICENSE\n\n[MIT @ Alchemy](https://github.com/IceEnd/electron-watch/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficeend%2Felectron-watch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ficeend%2Felectron-watch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficeend%2Felectron-watch/lists"}