Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Leo Nodejs SDK
A Nodejs interface to interact with the Leo Platform
Quick Start Guide: https://github.com/LeoPlatform/Leo
Documentation: https://docs.leoplatform.io
npm install leo-sdk
To load data onto the bus on AWS, you need to have a valid leo_config.js file. If you don't have one already, the easiest way to create one is to create a quickstart project and let the system configure the AWS settings for you.
Note: If you're using the SDK within a microservice, we bootstrap the config for you, otherwise you'll have to specify the path to your leo_config.js.
Bash example:
export leo_config_bootstrap_path='/path/to/leo_config.js'
Javascript example:
process.env.leo_config_bootstrap_path = '/path/to/leo_config.js';
Next, you'll have to make sure your NODE_ENV matches the environment configured in leo_config.js.
Now you can write to the new Stream:
let leo = require("leo-sdk");
let botId = "producerBotId";
let queueName = "queueName";
let stream = leo.load(botId, queueName);
// Write 10 events to the leo bus
for (let i = 0; i < 10; i++) {
stream.write({
now: Date.now(),
index: i,
number: Math.round(Math.random() * 10000)
});
}
stream.end(err=>{
console.log("All done loading events", err);
});
Next in order to read from the stream
let leo = require("leo-sdk");
let botId = "offloadBotId";
let queueName = "queueName";
leo.offload({
id: botId,
queue: queueName,
each: (payload, meta, done) =>{
console.log(payload);
console.log(meta);
done(null, true); // Report this event was handled
}
}, (err)=>{
console.log("All done processing events", err);
});
You can also enrich from one queue to another
let leo = require("leo-sdk");
let botId = "enrichBotId";
let inQueueName = "queueName";
let outQueueName = "enrichedQueueName";
leo.enrich({
id: botId,
inQueue: inQueueName,
outQueue:outQueueName,
// optional batch parameter:
batch: 50, // batch every 50 records, or:
// optional batch as object with optional parameters:
batch: {
count: 50, // batch every 50 records, or:
bytes: 500, // batch every 500 bytes, or:
time: 1000, // batch every 1000 milliseconds (1 second)
},
each: (payload, meta, done) =>{
// Add new data to the event payload
done(null, Object.assign({
enriched: true,
numberTimes2: payload.number * 2,
enrichedNow: Date.now()
}, payload));
}
}, (err)=>{
console.log("All done processing events", err);
});
Want to hire an expert, or need technical support? Reach out to the Leo team: https://leoinsights.com/contact
FAQs
Load data onto the LEO Platform
The npm package leo-sdk receives a total of 1,073 weekly downloads. As such, leo-sdk popularity was classified as popular.
We found that leo-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 7 open source maintainers 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
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.