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.
@aboviq/kollektor
Advanced tools
Generic file collector, useful for mono repos and microservices
Generic file collector, useful for mono repos and microservices
Install @aboviq/kollektor
using npm:
npm install @aboviq/kollektor
const kollektor = require('@aboviq/kollektor');
// Read all package.json files in a mono-repo async:
const packages = await kollektor({
handlers: {
'package.json': packageFile => require(packageFile)
}
});
// ...or sync:
const packages = kollektor.sync({
handlers: {
'package.json': packageFile => require(packageFile)
}
});
kollektor(options)
Name | Type | Description |
---|---|---|
options | Object | Options for specifying the behaviour of Kollektor |
Returns: Promise<Array<Object>>
, all collected information depending on given handlers.
kollektor.sync(options)
Name | Type | Description |
---|---|---|
options | Object | Options for specifying the behaviour of Kollektor |
Returns: Array<Object>
, all collected information depending on given handlers.
options.cwd
Type: String
Default: process.cwd()
Sets the current working directory
options.handlers
Type: Object<Handler>
Example:
{
"handlers": {
"package.json": () => {},
"*.yml": () => {},
"README.md": () => {}
}
}
Handler
definitionType: Function
Signature: handlerName :: String -> Object -> Object
handlerName
is the name of the handler and is usually a filename, e.g. "package.json"
which will call the handler for each package.json file it finds. The handlerName
can also be a simple pattern matching multiple files, e.g: "*.yml"
.
When a file is found that matches the handlerName
the handler function will be called with these arguments:
Name | Type | Description |
---|---|---|
fullPath | String | The full path to the found file |
data | Object | This contains dir (the relative path of the folder), dirPath (the full path of the folder) and all data returned from previous handlers affecting the same folder |
The handler function can be async (return a promise) for the asynchronous version of Kollektor but must be synchronous for the sync version.
Any Object
returned from a handler is merged with the current folder's data
and will be fed to the next handler affecting files in the same folder. When all handlers have been called and completed for a specific folder the resulting data
is what's being returned in the Array
of collected information. See the tests for more details on how it works.
See Contribution Guidelines and our Code Of Conduct.
MIT © Aboviq AB
FAQs
Generic file collector, useful for mono repos and microservices
The npm package @aboviq/kollektor receives a total of 0 weekly downloads. As such, @aboviq/kollektor popularity was classified as not popular.
We found that @aboviq/kollektor 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.