npm

npm’s 2019 JavaScript ecosystem survey analysis is now available!Get your copy here »

auto-refresher

0.0.1 • Public • Published

Auto Refresher

Refresh the browser page if called. It works well with gulp and nodemon (or gulp-nodemon).

Installation

$ npm install auto-refresher

Usage

In gulpfile.js:

var gulp = require('gulp');
var nodemon = require('gulp-nodemon');
 
var refresh = require('auto-refresher')({
    port: 7890,
    redirect: "http://192.168.1.100:3000"
});
 
gulp.task("nodemon", function () {
    nodemon({
        script: "app.js",
        ext: "js html ejs",
    })
    .on('restart', function () {
        // delay to refresh until server restarted
        setTimeout(refresh, 500);
    });
});

Keywords

none

install

npm i auto-refresher

Downloadsweekly downloads

0

version

0.0.1

license

MIT

last publish

collaborators

  • avatar
Report a vulnerability