configfiles

Get files from a configuration using globule.

Usage no npm install needed!

<script type="module">
  import configfiles from 'https://cdn.skypack.dev/configfiles';
</script>

README

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' } ] ]