🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

fork-events

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fork-events

Turns messages to events

1.3.0
latest
Source
npm
Version published
Weekly downloads
3
50%
Maintainers
1
Weekly downloads
 
Created
Source

Example of gulp serve task with fork-events instead of nodemon

gulp.task('serve', function() {
  var server = ForkEvents.fork('.'); // Your server script

  server.on('started', function(e) {
    if (e.reforked) {
      browserSync.reload({ stream: false });
    } else {
      browserSync.init({
        notify: false,
        port: 8080,
        proxy: 'http://localhost:8001' // HAPI server
      });
    }
  });

  gulp.watch(['ff-api/lib/controllers/**/*'], server.refork);

  gulp.watch(['ff-web/lib/assets/**/*'], ['web:assets']);
  gulp.watch(['ff-web/lib/controllers/**/*'], server.refork);
  gulp.watch(['ff-web/lib/views/**/*'], browserSync.reload);
});

On hapi side you just need to add 3 lines of code to start callback

// index.js
Glue.compose(manifest, {relativeTo: Path.join(__dirname, '.')}, function (err, server) {
  server.start(function () {

    // This 3 lines
    if (process.send) {
      process.send({event: 'started'});
    }

  });
});

Keywords

fork

FAQs

Package last updated on 11 Feb 2015

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