
Research
SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.
actionhero-client
Advanced tools
#ActionheroClient (for nodeJS)
This library makes it easy for one nodeJS process to talk to a remote actionhero server.
This library makes use of actionhero's TCP socket connections to enable fast, stateful connections. This library also allows for many concurrent and asynchronous requests to be running in parallel by making use of actionhero's message counter.
note: This Library is a server-server communication libary, and is NOT the same as the websocket client library that is generated via the actionhero server.
Installation should be as simple as:
npm install --save actionhero-client
and then you can include it in your projects with:
var ActionheroClient = require("actionhero-client");
var client = new ActionheroClient();
Once you have included the ActionheroClient library within your project, you can connect like this:
client.connect({
host: "127.0.0.1",
port: "5000",
}, callback);
default options (which you can override) are:
var defaults = {
host: "127.0.0.1",
port: "5000",
delimiter: "\r\n",
logLength: 100,
secure: false,
timeout: 5000,
reconnectTimeout: 1000,
reconnectAttempts: 10,
};
ActionheroClient will emit a few types of events (many of which are caught in the example below). Here are the events, and how you might catch them:
client.on("connected", function(null){})client.on("end", function(null){})client.on("welcome", function(welcomeMessage){})
client.on("error", function(errorMessage){})
client.on("say", function(messageBlock){})
timeStamp, room, from, and messageclient.on("timeout", function(err, request, caller){})
One you are connected (by waiting for the "connected" event or using the connect callback), the following methods will be available to you:
ActionheroClient.disconnect(next)ActionheroClient.paramAdd(key,value,next)
ActionheroClient.paramDelete(key,next)ActionheroClient.paramsDelete(next)ActionheroClient.paramView(key,next)ActionheroClient.paramsView(next)ActionheroClient.details(next)ActionheroClient.roomView(room, next)ActionheroClient.roomAdd(room,next)ActionheroClient.roomLeave(room,next)ActionheroClient.say(room, msg, next)ActionheroClient.action(action, next)
ActionheroClient.actionWithParams(action, params, next)
{key: "myKey", value: "myValue"}Each callback will receive the full data hash returned from the server and a timestamp: (err, data, duration)
There are a few data elements you can inspect on actionheroClient:
ActionheroClient.lastLine
ActionheroClient.userMessages
say message from all usersActionheroClient.log
ActionheroClient.messageCount
var ActionheroClient = require("actionhero-client");
var client = new ActionheroClient();
client.on("say", function(msgBlock){
console.log(" > SAY: " + msgBlock.message + " | from: " + msgBlock.from);
});
client.on("welcome", function(msg){
console.log("WELCOME: " + msg);
});
client.on("error", function(err, data){
console.log("ERROR: " + err);
if(data){ console.log(data); }
});
client.on("end", function(){
console.log("Connection Ended");
});
client.on("timeout", function(err, request, caller){
console.log(request + " timed out");
});
client.connect({
host: "127.0.0.1",
port: "5000",
}, function(){
// get details about myself
console.log(client.details);
// try an action
var params = { key: "mykey", value: "myValue" };
client.actionWithParams("cacheTest", params, function(err, apiResponse, delta){
console.log("cacheTest action response: " + apiResponse.cacheTestResults.saveResp);
console.log(" ~ request duration: " + delta + "ms");
});
// join a chat room and talk
client.roomAdd("defaultRoom", function(err){
client.say("defaultRoom", "Hello from the ActionheroClient");
client.roomLeave("defaultRoom");
});
// leave
setTimeout(function(){
client.disconnect(function(){
console.log("all done!");
});
}, 1000);
});
FAQs
ActionHero client for other node.js servers to use
The npm package actionhero-client receives a total of 4 weekly downloads. As such, actionhero-client popularity was classified as not popular.
We found that actionhero-client 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.

Research
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.

Company News
Socket is proud to join the OpenJS Foundation as a Silver Member, deepening our commitment to the long-term health and security of the JavaScript ecosystem.

Security News
npm now links to Socket's security analysis on every package page. Here's what you'll find when you click through.