
Product
Introducing Reports: An Extensible Reporting Framework for Socket Data
Explore exportable charts for vulnerabilities, dependencies, and usage with Reports, Socket’s new extensible reporting framework.
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 29 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.

Product
Explore exportable charts for vulnerabilities, dependencies, and usage with Reports, Socket’s new extensible reporting framework.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.