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.
Functional, promise-based tools for processing node-task input objects.
Iterate over node-task inputs and map their sources for transformation by a provided callback. Return a promise which resolves to the modified input.
extruder.map(input, fn, context)
input
A node-task input object.fn
A method to be invoked for each source item. Its return value (can be a promise) will replace each source item. fn(source, dest)
context
The context the fn
will be called with.var extruder = require('./lib/extruder');
var sources = ['path/to/source1', 'path/to/source2'];
extruder.map(sources, function(source, dest) {
return source+'mapped';
}).then(function(result) {
console.log(result); // ['path/to/source1mapped', 'path/to/source2mapped'];
});
var sourceDestPairs = [
{ src: 'path/to/source1', dest: 'path/to/dest' },
{ src: ['path/to/source2', 'path/to/source3'], dest: 'path/to/dest' }
];
extruder.map(sourceDestPairs, function(source, dest) {
return source+'mapped';
}).then(function(result) {
console.log(result); // [ { src: 'path/to/source1', dest: 'path/to/dest' },
// { src: 'path/to/source2-path/to/source3, dest: 'path/to/dest' } ]
});
Iterate over node-task inputs and reduce their sources with a provided callback. Return a promise which resolves to the modified input.
extruder.reduce(input, fn, context)
input
A node-task input object.fn
A method to be invoked for each source array. Its return value (can be a promise) will replace each source array. fn(source, dest)
context
The context the fn
will be called with.var extruder = require('extruder');
var sources = ['path/to/source1', 'path/to/source2'];
extruder.reduce(sources, function(sources, dest) {
return sources.join('-');
}).then(function(result) {
console.log(result); // 'path/to/source1-path/to/source2';
});
var sourceDestPairs = [
{ src: 'path/to/source1', dest: 'path/to/dest' },
{ src: ['path/to/source2', 'path/to/source3'], dest: 'path/to/dest' }
];
extruder.reduce(sourceDestPairs, function(sources, dest) {
return sources.join('-');
}).then(function(result) {
console.log(result); // [ { src: 'path/to/source1', dest: 'path/to/dest' },
// { src: 'path/to/source2-path/to/source3', dest: 'path/to/dest' } ]
});
FAQs
Functional tools for processing node-task input objects.
The npm package extruder receives a total of 19 weekly downloads. As such, extruder popularity was classified as not popular.
We found that extruder 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.
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.