Socket
Socket
Sign inDemoInstall

poly-socketio

Package Overview
Dependencies
8
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    poly-socketio

Polyglot SocketIO server that allows cross-language communication via JSON


Version published
Weekly downloads
62
decreased by-28.74%
Maintainers
1
Install size
45.1 MB
Created
Weekly downloads
 

Readme

Source

poly-socketio npm version CircleCI Code Climate Test Coverage

Polyglot SocketIO server that allows cross-language communication via JSON

Installation

npm i --save poly-socketio

Usage

This is used in AIVA to communicate JSON data among the Nodejs, Python and Ruby runtimes.

const polyIO = require('poly-socketio')
const IOPORT = 6466
var ioPromise = polyIO.server({port: IOPORT, clientCount: 1, timeoutMs: 15000, debug: false})
polyIO.client({port: IOPORT}) // this exposes a global.client

var msg = {
  input: 'hello js',
  to: 'echo.js',
  intent: 'ping'
}
global.client.pass(msg)
  .then((reply) => {
    if (reply.output === 'ping hello js') {
      console.log('success!')
    } else {
      console.log('error')
    }
  })

Keywords

FAQs

Last updated on 15 Jan 2018

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