Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
@agrarium/plugin
Advanced tools
Base class for plugins implementations. Every plugin is the simple JS class wich needs to provide some public interface for Agrarium.
Both methods gather
and seed
have the same signature but they have a diffrent time of execution.
It's async method wich returns simple object any mined data in keys. This method works in parallel in all chunks. Also, order of this method executions in different plugins not garanted.
Example:
const { Plugin } = require('agrarium');
const FormData = require('form-data');
// Fetching data by http request
class MyPlugin extends Plugin {
async gather({ key }) {
const form = new FormData();
form.append('component', key);
return {
my: await got.post('myApiWithComponentsInfo.ru', {
body: form
})
};
}
}
It's also async method wich returns simple object any mined data in keys. This method works before main stream of the gather
methods and you can use this information in the any gather method of any plugin. Also, order of this method executions in different plugins not garanted.
Example:
const { Plugin } = require('agrarium');
// Collectiong components names
class MyPlugin extends Plugin {
async seed({ key }, context) {
return {
components: context.components ?
[].concat(context.components, component.key) :
[component.key]
};
}
}
It's set of helpers for better plugins writing experience.
Simple helper for reading files from fs with cache.
Iterator for files and thier sources.
FAQs
Base API for Agrarium plugins
The npm package @agrarium/plugin receives a total of 1 weekly downloads. As such, @agrarium/plugin popularity was classified as not popular.
We found that @agrarium/plugin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.