Socket
Socket
Sign inDemoInstall

socketio-transceiver

Package Overview
Dependencies
127
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    socketio-transceiver

Real-time pubsub middleware for Express, using Socket.io.


Version published
Weekly downloads
2
decreased by-50%
Maintainers
1
Install size
8.54 MB
Created
Weekly downloads
 

Readme

Source

Transceiver

Transceiver adds real-time pubsub functionality to your Express.js app and optionally integrates with an Angular.js frontend. Based off of ideas (and code) from Sails.js, Transceiver lets you do things like this on your server:

app.get('/api/v1/users', function (req, res, next) {
  User.find().then(function(users) {
    res.json(users);
    if (res.io) {
      res.io.subscribe('User');
    }
  });
});

app.post('/api/v1/users', function (req, res, next) {
  User.create(req.query).then(function(user) {
    res.json(user);
    if (res.io) {
      res.io.publishCreate('User', user);
    }
  });
});

And things like this on your frontend (Angular in this case):

socket.get('/api/v1/users', function(users) {
    console.log("Users are:", users);
    $scope.$on("create:user", function(user) {
        console.log("New user created:", user);
    });
});

Tranceiver is currently considered an alpha library, meaning that it's not ready for embedding in production projects just yet.

Keywords

FAQs

Last updated on 11 Sep 2016

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc