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

reloader

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reloader

Restart application on file change, work even on Windows

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

reloader

Reload your Node.js application if it's source code changed. Tested on Windows, Mac OSX, Linux.

How to use:

To use it just include 'reloader' as usual NodeJS module and put code that must be started after every restart in 'onReload' callback. eg.

var reloader = require('reloader');
reloader({
    onReload: function () {
        app.listen(3000);
}});

In case if you go to use Reloader with Express framework:

// Reloader setup demonstration
var app = require('express').createServer();

app.configure(function () {
    app.use(app.router);

    require('reloader')({
        watchModules: true,
        onStart: function () {
            console.log('Started on port: 3000');
        },
        onReload: function () {
            app.listen(3000);
        }});
});

app.get('/', function (req, res) {
    res.send('Work!');
});

Parameters

watchModules: false onRestart: function onStart: function

Keywords

development

FAQs

Package last updated on 23 Jan 2012

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