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

milton

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

milton

pub/sub server and client powered by scuttlebutt

latest
Source
npmnpm
Version
0.0.2
Version published
Maintainers
1
Created
Source

milton

Build Status

Overview

Milton is a publish subscribe client and server for node.js based on the scuttlebutt event emitter. Clients can recieve new events from any other connected client. Install globally and run 'milton' to launch the milton server, clients can connect to the server to emit and recieve events.

Launch the server manually and replicate with remote process' to create a mesh network.

install

npm install milton -g

Server

Launch a local instance

milton

Launch a local server and replicate with a remote milton server

milton -p 9999 --replicate 192.168.0.1:8000

# dont use spaces if passing an array
milton -p 9998 -r ['192.168.0.1:8000','127.0.0.1:9999']

Library usage


var milton = require('milton/client');
	
var client = milton({ port: 8000 });

var event = {
	demo: true
};

process.nextTick(function () {
	client.emit('demo', event);
});
	
client.on('demo', function (data) {
	console.log('[recieved] ', data);
});

As a pull stream sink

var pull = require('pull-stream');
var sink = require('milton/pull/sink')();

pull(
	pull.values([ { demo: true } ]),
	sink('demo_channel')
)

As a pull stream source

var pull   = require('pull-stream');
var source = require('milton/pull/source')();

pull(
	source('demo_channel'),
	pull.log()
)

Peer to peer

Manually create servers and replicate with remote processes to create a peer to peer mesh.

var server = require('milton/server')();

// create a milton server manually 
// and replicate with a remote milton server...
//
server.start(8000, function () {
	server.replicate('192.168.0.100', 9000);
});

Keywords

pub sub

FAQs

Package last updated on 29 Jan 2017

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