{"id":14965922,"url":"https://github.com/kriasoft/restart","last_synced_at":"2025-07-22T17:34:43.810Z","repository":{"id":57159191,"uuid":"129731605","full_name":"kriasoft/restart","owner":"kriasoft","description":"Restart Node.js app in development mode","archived":false,"fork":false,"pushed_at":"2018-08-31T18:51:20.000Z","size":21,"stargazers_count":4,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-09T02:27:50.544Z","etag":null,"topics":["dev-tool","dev-tools","development","node","node-js","nodejs","nodemon","npm","npm-scripts","script","tools","watch","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kriasoft.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-04-16T11:23:19.000Z","updated_at":"2021-05-11T03:30:54.000Z","dependencies_parsed_at":"2022-09-07T20:11:38.286Z","dependency_job_id":null,"html_url":"https://github.com/kriasoft/restart","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/kriasoft/restart","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kriasoft%2Frestart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kriasoft%2Frestart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kriasoft%2Frestart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kriasoft%2Frestart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kriasoft","download_url":"https://codeload.github.com/kriasoft/restart/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kriasoft%2Frestart/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265685159,"owners_count":23811131,"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":["dev-tool","dev-tools","development","node","node-js","nodejs","nodemon","npm","npm-scripts","script","tools","watch","yarn"],"created_at":"2024-09-24T13:35:34.387Z","updated_at":"2025-07-22T17:34:43.788Z","avatar_url":"https://github.com/kriasoft.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Node.js Restart\n\n[![NPM version](https://img.shields.io/npm/v/restart.svg)](https://www.npmjs.com/package/restart)\n[![NPM downloads](https://img.shields.io/npm/dw/restart.svg)](https://www.npmjs.com/package/restart)\n[![Build Status](https://img.shields.io/travis/kriasoft/restart.svg)](https://travis-ci.org/kriasoft/restart)\n\nThis module is designed to restart Node.js app in development mode, e.g. after compilation with\nBabel/TypeScript is complete.\n\n## How to Install\n\n```bash\n$ npm install restart --save-dev\n```\n\n## How to Use\n\n#### `build/app.js`\n\n```js\nconst express = require('express');\nconst app = express();\n\nlet count = 0;\n\napp.get('/', (req, res) =\u003e {\n  res.send(`count: ${++count}`);\n});\n\nmodule.exports = app.listen(8080);\n```\n\n#### `server.js`\n\n```js\nif (process.env.NODE_ENV === 'production') {\n  // In a production environment launch the Node.js app directly.\n  require('./build/app');\n} else {\n  // Otherwise, start building the app from source and\n  // restart it upon new changes in the /build folder.\n  const restart = require('restart');\n  const build = require('./scripts/build');\n  build({\n    watch: true,\n    onComplete: () =\u003e {\n      restart({ entry: './build/app' });\n    },\n  });\n}\n```\n\n```bash\n$ node ./server\n```\n\n## License\n\nCopyright (c) 2018-present Kriasoft | MIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkriasoft%2Frestart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkriasoft%2Frestart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkriasoft%2Frestart/lists"}