Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@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
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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.