
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
npm install athome -S
const AtHome = require('athome')
const atHome = new AtHome()
const clusterId = atHome.join((n, m) => n + m)
atHome.pull(clusterId)
// Since there is no tasks, this pull will be added to pulls waiting list.
atHome.execute(3, 4)
.then(console.log) // => 7
More realistic use case:
const AtHome = require('athome')
const atHome = new AtHome()
const functionTakesLongLongTimeRunsFarFarAway = n => new Promise(resolve => setTimeout(() => resolve(n * n), 1000))
const clusterId = atHome.join(functionTakesLongLongTimeRunsFarFarAway)
atHome.execute(8).then(console.log)
// Since there is no pulls, the task will be added to waiting list
atHome.pull(clusterId)
// A second later, output 64
With built in validator:
const AtHome = require('athome')
const atHome = new AtHome({ validator: result => result > 0 })
// result must be greater than 0
const reverse = n => new Promise(resolve => setTimeout(() => resolve(-n), 1000))
const stay = n => new Promise(resolve => setTimeout(() => resolve(n), 1000))
const reverseId = atHome.join(reverse)
const stayId = atHome.join(stay)
atHome.pull(reverseId)
atHome.pull(reverseId)
atHome.pull(stayId)
atHome.execute(-3).then(console.log)
atHome.execute(2).then(console.log)
// First -3 will go throw 1st reverse pull and output 3,
// the second 2 will go throw 2nd reverse pull and output -2,
// which will falls the validation, so it will go again with the 3rd stay pull,
// and output 2, which pass the validation.
// output: 3, 2
return atHome instance.
| Options | Type | Detail | Default |
|---|---|---|---|
| validator | Function => Promise/Boolean | A function used to validate result | () => true |
| retries | Number | Max retries limit | 5 |
Add a cluster to @Home network.
clusterFunction: function will be called with all params when this cluster is executing task.
String HomeID, cluster uuidPull task for this cluster, the correspond clusterFunction will be called when there is task available.
id: clutser's uuid
return: Promise<boolean> if this compute succeed
Execute a task.
The task will be either executed now if there is waiting pulls, or added to task waiting list for pulls.
params: params which pass to clusterFunction
Promise resolve the result, or reject when retries too much.Remove a cluster from @Home network, this will also:
id: cluster's uuid
Map<HomeID, Home>Map with HomeID(uuid) and Home Instances.
HomeID(uuid)numberNumber of resolves.
numberNumber of rejects, include invalid response.
numberTime stamp, refresh when:
Feel free to ask any question and create pull request :D
FAQs
Task Distribution
We found that athome 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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.