New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

ee-protocol-json

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ee-protocol-json

simple JSON streaming protocol. transmitts & receives JSON objects.

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

ee-protocol-json

simple JSON streaming protocol. transmitts & receives JSON objects.

build status

Build Status

installation

npm install ee-protocol-json

usage

on the receiving end of the line

var   JSONProtocolHandler 	= require( "ee-protocol-json" )
	, decoder 				= new JSONProtocolHandler()
	, incomingPacketData 	= new Buffer( [ 15, 0, 0, 0, 7b, 22, 66, 61, 62, 69, 61, 6e, 22, 3a, 22, 74, 68, 65, 20, 6b, 69, 6e, 67, 22, 7d ] );

decoder.wirte( incomingPacketData );

decoder.on( "data", function( JSONObject ){
	log( JSONObject ) // { fabian: "the king" }
} )

on the transmitting end of the line you must pass true to the contructor!

var   JSONProtocolHandler 	= require( "ee-protocol-json" )
	, encoder 				= new JSONProtocolHandler( true )
	, outgoingPacketData 	= new Buffer( { fabian: "the king" } );

encoder.wirte( outgoingPacketData );

instance.on( "data", function( data ){
	log( data ) // 15 0 0 0 7b 22 66 61 62 69 61 6e 22 3a 22 74 68 65 20 6b 69 6e 67 22 7d
} )

Keywords

protocol

FAQs

Package last updated on 01 Nov 2013

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