Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Client library for the Sonic protocol over WebSockets
var Client = require('sonic-js').Client;
var assert = require('assert');
var client = new Client('wss://0.0.0.0:443');
var query = {
query: '5',
config: {
"class" : "SyntheticSource",
"seed" : 1000,
"progress-delay" : 10
}
};
/* Client.prototype.run */
client.run(query, function(err, res) {
if (err) {
console.log(err);
return;
}
res.forEach(function(e) {
console.log(e);
});
client.close();
console.log('exec is done!');
});
/* Client.prototype.stream */
var stream = client.stream(query);
var done = 0;
stream.on('data', function(data) {
console.log(data);
});
stream.on('progress', function(p) {
done += p.progress;
console.log('running.. ' + done + "/" + p.total + " "+ p.units);
});
stream.on('output', function(out) {
console.log(out);
});
stream.on('metadata', function(meta) {
console.log('metadata: ' + JSON.stringify(meta));
});
stream.on('done', function() {
console.log('stream is done!');
});
stream.on('error', function(err) {
console.log('stream error: ' + err);
});
For a more complete example, check examples/example.js.
If you would like to contribute to the project, please fork the project, include your changes and submit a pull request back to the main repository.
MIT License
FAQs
ws client library for the Sonic protocol
The npm package sonic-js receives a total of 0 weekly downloads. As such, sonic-js popularity was classified as not popular.
We found that sonic-js 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
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.