
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Write Storm topologies in JavaScript.
import WordCount from './wordcount';
import SplitSentence from './splitsentence';
import RandomSentence from './randomsentence';
import Cyclone, { TopologyBuilder } from 'cyclone';
let builder = new TopologyBuilder();
builder.setSpout('spout', new RandomSentence());
builder.setBolt('split', new SplitSentence(), 4).shuffleGrouping('spout');
builder.setBolt('count', new WordCount(), 4).fieldsGrouping('split', [ 'word' ]);
Cyclone.run(builder, { name: 'mytopology' });
To write a Spout, merely extend the provided Spout
class and write your own implementation.
import { Spout } from 'cyclone';
export default class RandomSentence extends Spout {
declareOutputFields() {
return [ 'sentence' ];
}
nextTuple() {
let rand = Math.floor(Math.random() * SENTENCES.length);
this.emit({ tuple: [ SENTENCES[rand] ], anchorTupleId: id });
done();
}
}
log
emit
declareOutputFields()
(optional, defaults to []
)
getComponentConfiguration()
(optional, defaults to {}
)
nextTuple(id, done)
(required)
ack(id, done)
(optional)
fail(id, done)
(optional)
Similar to Spouts, Bolts are created by extending the provided Bolt
base class.
import { Bolt } from 'cyclone';
export default class MyBolt extends Bolt {
declareOutputFields() {
return [ 'words' ];
}
process(tuple, done) {
let [ sentence ] = tuple.values;
let words = sentence.split(/\s+/);
for (let word of words) {
this.emit({ tuple: [ word ], anchorTupleId: tuple.id });
}
done();
}
}
log
emit
declareOutputFields()
(optional, defaults to []
)
getComponentConfiguration()
(optional, defaults to {}
)
prepare(config, context, done)
(optional)
process(tuple, done)
(required)
To run a local cluster simply run your topology file with the --local
flag. For
example, if the Basic Example above were your index.js file, simply run
$ node . --local
. You will need Apache Storm installed and on your path as well
as an invocation of run
in your topology file:
Cyclone.run(builder, { name: 'mytopology' });
To submit a topology you will need Apache Storm installed an on your path. If
that's the case, the easiest way would be to run the cyclone
command against
your topology using an npm script:
{
"main": "index.js",
"scripts": {
"submit": "cyclone"
}
}
In this case, the cyclone
command will default to using the entrypoint file as
identified in the "main"
package.json
property. Otherwise a topology can
be specified using the -t/--topology
flag. By default, this submits the topology
to the Nimbus host configured in ~/.storm/storm.yaml
.
# ~/.storm/storm.yaml
nimbus.host: "255.255.255.255"
FAQs
A JavaScript Apache Storm topology implementation.
The npm package cyclone receives a total of 0 weekly downloads. As such, cyclone popularity was classified as not popular.
We found that cyclone 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
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.