{"id":14976548,"url":"https://github.com/lamo2k123/daemon-command-webpack-plugin","last_synced_at":"2025-10-27T20:32:10.890Z","repository":{"id":141857035,"uuid":"63816734","full_name":"lamo2k123/daemon-command-webpack-plugin","owner":"lamo2k123","description":"Run and restart npm commands after emit file webpack builds","archived":false,"fork":false,"pushed_at":"2020-10-24T13:34:50.000Z","size":75,"stargazers_count":12,"open_issues_count":4,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-01T08:06:29.102Z","etag":null,"topics":["appveyor","es6","node","node-js","nodejs","travis","webpack","webpack-plugin","webpack2","yarn"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lamo2k123.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-07-20T21:45:07.000Z","updated_at":"2017-04-09T11:19:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"874b542a-b94a-49ad-9660-140b35460139","html_url":"https://github.com/lamo2k123/daemon-command-webpack-plugin","commit_stats":{"total_commits":31,"total_committers":3,"mean_commits":"10.333333333333334","dds":0.09677419354838712,"last_synced_commit":"9fff6eb2be3635c9a3d07fec9216d6923c527b4f"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lamo2k123%2Fdaemon-command-webpack-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lamo2k123%2Fdaemon-command-webpack-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lamo2k123%2Fdaemon-command-webpack-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lamo2k123%2Fdaemon-command-webpack-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lamo2k123","download_url":"https://codeload.github.com/lamo2k123/daemon-command-webpack-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238553312,"owners_count":19491406,"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":["appveyor","es6","node","node-js","nodejs","travis","webpack","webpack-plugin","webpack2","yarn"],"created_at":"2024-09-24T13:54:03.310Z","updated_at":"2025-10-27T20:32:10.552Z","avatar_url":"https://github.com/lamo2k123.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## daemon-command-webpack-plugin\n[![license](https://img.shields.io/github/license/mashape/apistatus.svg?maxAge=2592000\u0026style=flat-square)][License]\n[![travis](https://img.shields.io/travis/lamo2k123/daemon-command-webpack-plugin/master.svg?maxAge=2592000\u0026style=flat-square)][Travis]\n[![AppVeyor](https://img.shields.io/appveyor/ci/lamo2k123/daemon-command-webpack-plugin.svg?maxAge=2592000\u0026style=flat-square)][appVeyor]\n[![npm](https://img.shields.io/npm/dt/daemon-command-webpack-plugin.svg?maxAge=2592000\u0026style=flat-square)][NPM]\n[![npm](https://img.shields.io/npm/v/daemon-command-webpack-plugin.svg?maxAge=2592000\u0026style=flat-square)][NPM]\n\nThis is simple webpack plugin that monitors webpack events and start or restart npm/yarn command.\nThe main purpose of this plugin is to restart node process when webpack has finised rebuilding the source tree.\nIt is also possible to wait for the marker to make sure the process is finished doing the job (like starting the web server)\n\n## Installing as a package\nUse NPM:\n`npm i daemon-command-webpack-plugin -D` or `npm install daemon-command-webpack-plugin --save-dev`\n\nUse YARN:\n`yarn add daemon-command-webpack-plugin --dev`\n## Usage\n```javascript\n// package.json\n\n{\n  \"name\": \"me-app\",\n  \"version\": \"1.0.0\",\n  \"scripts\": {\n      \"start:dev:env\": \"node server/build/index.js\",\n      \"start:dev\": \"NODE_ENV=development PORT=3000 node server/build/index.js\",\n    },\n}\n```\n\n```javascript\n// webpack.config.js\n\nimport DaemonCommandPlugin from 'daemon-command-webpack-plugin';\n\nmodule.exports = {\n  // ... rest of config\n  plugins: [\n    // Command #1\n    new DaemonCommandPlugin('start:dev:env', {\n      spawn : {\n        env : {\n          NODE_ENV : 'development',\n          PORT : 3000\n        }\n      }\n    }),\n    // Command #2\n    new DaemonCommandPlugin('start:dev');,\n    // Command #3 use yarn\n    new DaemonCommandPlugin('start:dev', {\n      manager : 'yarn'\n    });\n  ]\n}\n```\n## Usage with marker\n```javascript\n// webpack.config.js\n\nimport DaemonCommandPlugin from 'daemon-command-webpack-plugin';\n\nmodule.exports = {\n  // ... rest of config\n  plugins: [\n    // Command #1\n    new DaemonCommandPlugin('start:dev', {\n      marker : true\n    });\n  ]\n}\n```\n\n```javascript\n// your-app.js\n\nimport express from 'express';\nimport marker from 'daemon-command-webpack-plugin/marker';\n\nlet app = express();\n\napp.listen(8080, () =\u003e {\n    console.log('Listen port: 8080');\n    marker();\n    // or\n    marker('Listen port: 8080'); // Custom message\n})\n```\n\n\n\n## Arguments\n* `command` [\\\u003cString\\\u003e][String] The package.json scripts command to run\n* `options` [\\\u003cObject\\\u003e][Object]\n    * `event` [\\\u003cString\\\u003e][String] Webpack life cycle event. Default: `after-emit`\n    * `marker` [\\\u003cBoolean\\\u003e][Boolean] Resolve promise when a marker is found to stdout. Default: `false`\n    * `spawn` [\\\u003cObject\\\u003e][Object] Spawn options\n        * `cwd` [\\\u003cString\\\u003e][String] Current working directory of the child process\n        * `env` [\\\u003cObject\\\u003e][Object] Environment key-value pairs\n        * `argv0` [\\\u003cString\\\u003e][String] Explicitly set the value of argv[0] sent to the child process. This will be set to command if not specified.\n        * `stdio` [\\\u003cArray\\\u003e][Array] | [\\\u003cString\\\u003e][String] Child's stdio configuration. (See options.stdio)\n        * `detached` [\\\u003cBoolean\\\u003e][Boolean] Prepare child to run independently of its parent process. Specific behavior depends on the platform, see options.detached)\n        * `uid` [\\\u003cNumber\\\u003e][Number] Sets the user identity of the process\n        * `gid` [\\\u003cNumber\\\u003e][Number] Sets the group identity of the process\n        * `shell` [\\\u003cBoolean\\\u003e][Boolean] | [\\\u003cString\\\u003e][String] If true, runs command inside of a shell. Uses `/bin/sh` on UNIX, and `cmd.exe` on Windows. A different shell can be specified as a string. The shell should understand the -c switch on UNIX, or /d /s /c on Windows. Defaults to false (no shell).\n\nUse `cwd` to specify the working directory from which the process is spawned. If not given, the default is to inherit the current working directory.\nUse `env` to specify environment variables that will be visible to the new process, the default is process.env.\n\n## Marker arguments\n* `out` [\\\u003cString\\\u003e][String] | [\\\u003cArray\\\u003e][Array] Your custom message\n\n## License\n[MIT][License]\n\n[License]: http://www.opensource.org/licenses/mit-license.php\n[NPM]: https://www.npmjs.com/package/daemon-command-webpack-plugin\n[Travis]: https://travis-ci.org/lamo2k123/daemon-command-webpack-plugin\n[appVeyor]: https://ci.appveyor.com/project/lamo2k123/daemon-command-webpack-plugin\n\n[String]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\n[Object]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\n[Number]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\n[Boolean]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type\n[Array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flamo2k123%2Fdaemon-command-webpack-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flamo2k123%2Fdaemon-command-webpack-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flamo2k123%2Fdaemon-command-webpack-plugin/lists"}