New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

restart

Package Overview
Dependencies
Maintainers
2
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

restart

Restart Node.js application in development mode.

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

Node.js Restart

NPM version NPM downloads Build Status

This module is designed to restart Node.js app in development mode, e.g. after compilation with Babel/TypeScript is complete.

How to Install

$ npm install restart --save-dev

How to Use

build/app.js
const express = require('express');
const app = express();

let count = 0;

app.get('/', (req, res) => {
  res.send(`count: ${++count}`);
});

module.exports = app.listen(8080);
server.js
if (process.env.NODE_ENV === 'production') {
  // In a production environment launch the Node.js app directly.
  require('./build/app');
} else {
  // Otherwise, start building the app from source and
  // restart it upon new changes in the /build folder.
  const restart = require('restart');
  const build = require('./scripts/build');
  build({
    watch: true,
    onComplete: () => {
      restart({ entry: './build/app' });
    },
  });
}
$ node ./server

License

Copyright (c) 2018-present Kriasoft | MIT License

Keywords

FAQs

Package last updated on 31 Aug 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc