
Research
/Security News
Fake imToken Chrome Extension Steals Seed Phrases via Phishing Redirects
Mixed-script homoglyphs and a lookalike domain mimic imToken’s import flow to capture mnemonics and private keys.
base-files-each
Advanced tools
Base plugin for iterating over an array of 'files' objects in a declarative configuration and writing them to the file system.
Base plugin for iterating over an array of 'files' objects in a declarative configuration and writing them to the file system.
Install with npm:
$ npm install base-files-each --save
var files = require('base-files-each');
var expand = require('expand-files');
var Base = require('base');
var pipeline = require('base-pipeline');
var each = require('base-files-each');
var vfs = require('base-fs');
var app = new Base();
app.use(pipeline());
app.use(each());
app.use(vfs());
// register pipeline plugins using the `.plugin` method
app.plugin('foo', function(options) {
return through.obj(function(file, enc, next) {
// do plugin stuff
next(null, file);
});
});
// use `expand-files` to expand a declarative configuration object
config = expand({
cwd: fixtures,
src: '*.txt',
dest: actual
});
// pass the config object to `.each()`
app.each(config)
.on('end', function() {
console.log('done!');
});
Iterate over an array of files objects in a declarative configuration, optionally run them through a plugin pipline, then write the files to the file system.
Params
config {Object}cb {Function}: Optional callback function. If callback is not passed, .eachStream is called and a stream is returned.Example
var expand = require('expand-files');
var config = expand.config({src: '*', dest: 'foo/'});
generate.each({files: [config]}, function(err) {
if (err) throw err;
console.log('done!');
});
// or
generate.each({files: [config]})
.on('end', function() {
console.log('done!');
});
Generate files configurations in series.
Params
config {Object}cb {Function}Example
var expand = require('expand-files');
var config = expand.config({src: '*', dest: 'foo/'});
generate.eachSeries({files: [config]}, function(err) {
if (err) throw err;
console.log('done!');
});
Generate files configurations in parallel.
Params
config {Object}returns {Stream}: returns stream with all process filesExample
var expand = require('expand-files');
var config = expand.config({src: '*', dest: 'foo/'});
generate.eachStream({files: [config]}, options)
.on('error', console.error)
.on('end', function() {
console.log('done!');
});
You might also be interested in these projects:
base-files-process: Plugin for processing files from a declarative configuration. | homepage
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Generate readme and API documentation with verb:
$ npm install verb && npm run docs
Or, if verb is installed globally:
$ verb
Install dev dependencies:
$ npm install -d && npm test
Jon Schlinkert
Copyright © 2016, Jon Schlinkert. Released under the MIT license.
This file was generated by verb, v0.9.0, on May 17, 2016.
FAQs
Base plugin for iterating over an array of 'files' objects in a declarative configuration and writing them to the file system.
We found that base-files-each demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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
Mixed-script homoglyphs and a lookalike domain mimic imToken’s import flow to capture mnemonics and private keys.

Security News
Latio’s 2026 report recognizes Socket as a Supply Chain Innovator and highlights our work in 0-day malware detection, SCA, and auto-patching.

Company News
Join Socket for live demos, rooftop happy hours, and one-on-one meetings during BSidesSF and RSA 2026 in San Francisco.