configfiles

0.3.4 • Public • Published

configfiles Build Status

Get files from a configuration using globule.

NPM

What?

var configfiles = require('configfiles');
 
configfiles({
  src: ['test/fixtures/*.js', '!test/fixtures/*.txt']
});
// [ { src:
//      [ 'test/fixtures/1.js',
//        'test/fixtures/2.js',
//        'test/fixtures/3.js' ] } ]
 
configfiles({
  src: ['test/fixtures/*'],
  dest: 'dest/file'
});
// [ { src:
//      [ 'test/fixtures/1.js',
//        'test/fixtures/2.js',
//        'test/fixtures/3.js',
//        'test/fixtures/bar.txt',
//        'test/fixtures/baz.txt',
//        'test/fixtures/foo.txt' ],
//     dest: 'dest/file' } ]
 
configfiles({
  files: {
    src: ['test/fixtures/*'],
    dest: 'dest/file'
  }
});
// [ { src:
//      [ 'test/fixtures/1.js',
//        'test/fixtures/2.js',
//        'test/fixtures/3.js',
//        'test/fixtures/bar.txt',
//        'test/fixtures/baz.txt',
//        'test/fixtures/foo.txt' ],
//     dest: 'dest/file' } ]
 
configfiles({
  files: [
    { src: ['test/fixtures/*.js'], dest: 'dest/file' },
    { src: ['test/fixtures/*.txt'] }
  ]
});
// [ { src:
//      [ 'test/fixtures/1.js',
//        'test/fixtures/2.js',
//        'test/fixtures/3.js' ],
//     dest: 'dest/file' },
//   { src:
//      [ 'test/fixtures/bar.txt',
//        'test/fixtures/baz.txt',
//        'test/fixtures/foo.txt' ] } ]
 
configfiles({
  files: ['test/fixtures/*.js']
});
// [ { src:
//      [ 'test/fixtures/1.js',
//        'test/fixtures/2.js',
//        'test/fixtures/3.js' ] } ]
 
configfiles(['test/fixtures/*.js']);
// [ { src:
//      [ 'test/fixtures/1.js',
//        'test/fixtures/2.js',
//        'test/fixtures/3.js' ] } ]
 
configfiles({
  expand: true,
  cwd: 'test/fixtures',
  src: '*.js',
  dest: 'dest/'
});
// [ [ { src: [Object], dest: 'dest/1.js' },
//     { src: [Object], dest: 'dest/2.js' },
//     { src: [Object], dest: 'dest/3.js' } ] ]

Package Sidebar

Install

npm i configfiles

Weekly Downloads

192

Version

0.3.4

License

none

Last publish

Collaborators

  • tkellen
  • jonschlinkert