
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
clusterfuck
Advanced tools
WIP cluster management.
Write your code once and use configuration to route your services together. You should be able to define whether cluster('foo') requires a local module or returns a http request to http://foo/ without touching code.
Every service is a Stream, so it works either required locally or over the network.
var clusterfuck = require('clusterfuck');
var cluster = clusterfuck({
'@mic/site-header': 'http://localhost:8000'
});
var header = cluster('@mic/site-header');
// over http
header().pipe(process.stdout);
var layout = cluster('@mic/site-layout');
// require()d locally
layout().pipe(process.stdout);
You can for example use minimist to inject service location through stdarg:
var minimist = require('minimist');
var clusterfuck = require('clusterfuck');
var cluster = clusterfuck(minimist(process.argv.slice(2)));
var header = cluster('@mic/site-header');
// over http
header().pipe(process.stdout);
var layout = cluster('@mic/site-layout');
// require()d locally
layout().pipe(process.stdout);
and launch via:
$ node server.js --@mic/site-header=http://localhost:8000
If no mapping is provided for a service, it will simply be require()d.
var cluster = clusterfuck({
'@mic/site-header': 'http://header.mic.com'
});
var header = cluster('@mic/site-header');
header('section', { some: 'opts' }).pipe(process.stdout)
will result in this request to get a header stream:
GET http://header.mic.com/section?some=opts
Nested properties are supported via qs.
var cluster = clusterfuck({
'@mic/site-header': {
source: 'http://header.mic.com',
cache: true
}
});
var header = cluster('@mic/site-header');
header('a').pipe(process.stdout); // fill the cache
// ...
header('a').pipe(process.stdout); // use the cache
// ...
header('b').pipe(process.stdout); // new args -> new cache
$ npm install clusterfuck
Create a cluster with given map from service names to remote locations.
EventEmitter, see Events.
Create a constructor for the service known as name.
Create a readable stream from service with optional string args and an array of opts.
The following events will be emitted for every outgoing request (read: not a require()), and will have the following properties:
request
idtransporturlresponse
idtransporturlstatusThere is a simple debug logger included, set the environment variable CLUSTERLOG=true to enable it.
Example:
cluster.events.on('response', function(res){
if (res.transport == 'http') console.log('GET %s %s', res.url, res.status);
});
MIT
FAQs
wip cluster management
We found that clusterfuck demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.