Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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
  • Socket score

Version published
Weekly downloads
0
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

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

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