Skip to content

Latest commit

 

History

History
124 lines (95 loc) · 2.54 KB

.verb.md

File metadata and controls

124 lines (95 loc) · 2.54 KB

{%= name %} {%= badge("fury") %}

{%= description %}

Install

{%= include("install-npm", {save: true}) %}

Usage

var config = require('{%= name %}');

All of the following normalize to the same object:

config('*.js', 'dist/')
//=> { files: [ { src: [ '*.js' ], dest: 'dist/' } ] }
config(['*.js'], 'dist/')
//=> { files: [ { src: [ '*.js' ], dest: 'dist/' } ] }
config({'dist/': '*.js'})
//=> { files: [ { src: [ '*.js' ], dest: 'dist/' } ] }
config({'dist/': ['*.js']})
//=> { files: [ { src: [ '*.js' ], dest: 'dist/' } ] }
config({src: '*.js', dest: 'dist/'})
//=> { files: [ { src: [ '*.js' ], dest: 'dist/' } ] }
config({src: ['*.js'], dest: 'dist/'})
//=> { files: [ { src: [ '*.js' ], dest: 'dist/' } ] }
config({files: {'dist/': '*.js'}})
//=> { files: [ { src: [ '*.js' ], dest: 'dist/' } ] }
config({files: {'dist/': ['*.js']}})
//=> { files: [ { src: [ '*.js' ], dest: 'dist/' } ] }
config({files: [{'dist/': ['*.js']}]})
//=> { files: [ { src: [ '*.js' ], dest: 'dist/' } ] }

Examples

All of the following:

// src | dest | options
config('*.js', 'dist/', {cwd: 'lib'});

// {src, dest, options}
config({src: '*.js', dest: 'dist/', options: {cwd: 'lib'}});

// {src, dest} | options
config({src: '*.js', dest: 'dist/'}, {cwd: 'lib'});

result in:

{ 
  options: { cwd: 'lib' },
  files: [ 
    { options: { cwd: 'lib' }, 
      src: [ '*.js' ], 
      dest: 'dist/' 
    } 
  ]
}

All of the following result in the same object:

config('lib/*.js', 'foo/');
config({'foo/': 'lib/*.js'});
config({dest: 'foo/', src: 'lib/*.js'});
//=> { files: [{ src: [ 'lib/*.js' ], dest: 'foo/' }]}

no dest

All of the following result in the same object:

config('lib/*.js');
config(['lib/*.js']);
config({'': 'lib/*.js'});
config({'': ['lib/*.js']});
config({src: 'lib/*.js'});
config({src: ['lib/*.js']});
config({src: 'lib/*.js', dest: ''});
config({src: ['lib/*.js'], dest: ''});
//=> {files: [{ src: ['lib/*.js'], dest: ''}]}

with dest

All of the following result in the same object:

config('lib/*.js', 'foo/');
config(['lib/*.js'], 'foo/');
config({'foo/': 'lib/*.js'});
config({'foo/': ['lib/*.js']});
config({src: ['lib/*.js'], dest: 'foo/'});
config({src: 'lib/*.js', dest: 'foo/'});
//=> {files: [{ src: ['lib/*.js'], dest: 'foo/'}]}

Related projects

{%= related(verb.related.list) %}

Running tests

{%= include("tests") %}

Contributing

{%= include("contributing") %}

Author

{%= include("author") %}

License

{%= copyright() %} {%= license %}


{%= include("footer") %}