expand-target 
Expand target definitions in a declarative configuration.
Table of contents
(Table of contents generated by verb)
Install
Install with npm
$ npm i expand-target --save
Usage
var target = require('expand-target');
Write declarative "target" definitions similar in concept to those used by grunt and make.
Basic example
target({
files: {
'a/': ['*.js'],
'b/': ['*.js'],
'c/': ['*.js']
}
});
results in
{
files: [
{
src: ['examples.js', 'index.js'],
dest: 'a/'
},
{
src: ['examples.js', 'index.js'],
dest: 'b/'
},
{
src: ['examples.js', 'index.js'],
dest: 'c/'
}
]
}
the same example with expand: true defined on the options
target({
options: { expand: true },
files: {
'a/': ['*.js'],
'b/': ['*.js'],
'c/': ['*.js']
}
});
results in
{
options: {
expand: true
},
files: [
{
src: ['examples.js'],
dest: 'a/examples.js'
},
{
src: ['index.js'],
dest: 'a/index.js'
},
{
src: ['examples.js'],
dest: 'b/examples.js'
},
{
src: ['index.js'],
dest: 'b/index.js'
},
{
src: ['examples.js'],
dest: 'c/examples.js'
},
{
src: ['index.js'],
dest: 'c/index.js'
}
]
}
See more examples. Visit expand-files for the full range of options and documentation.
Options
Any option from expand-files may be used. Please see that project for the full range of options and documentation.
options properties
The below "special" properties are fine to use either on an options object or on the root of the object passed to expand-files.
Either way they will be normalized onto the options object to ensure that [globby][] and consuming libraries are passed the correct arguments.
special properties
base
cwd
destBase
expand
ext
extDot
extend
flatten
rename
process
srcBase
example
Both of the following will result in expand being on the options object.
files({src: '*.js', dest: 'dist/', options: {expand: true}});
files({src: '*.js', dest: 'dist/', expand: true});
Related projects
Running tests
Install dev dependencies:
$ npm i -d && npm test
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Author
Jon Schlinkert
License
Copyright © 2015 Jon Schlinkert
Released under the MIT license.
This file was generated by verb-cli on September 02, 2015.