auto-refresher
v0.0.1
Published
Refresh the browser page if called. It works well with [gulp](https://github.com/gulpjs/gulp) and [nodemon](https://github.com/remy/nodemon) (or [gulp-nodemon](https://github.com/JacksonGariety/gulp-nodemon)).
Downloads
3
Readme
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);
});
});