gulp-src-files
v0.0.16
Published
Synchronous get filenames like a gulp.src
Downloads
392
Readme
gulpSrcFiles
Synchronous get filenames like a
gulp.src
example:
gulpSrcFiles= require 'gulp-src-files'
files= gulpSrcFiles [
'my_components/**/*.coffee.'
'!my_components/**/*.spec.coffee'
]
console.log files
###
[
'/path/to/my_components/index.coffee',
'/path/to/my_components/users.coffee',
'/path/to/my_components/images.coffee',
...
]
###
Usage for browserify
Can use expose
option for browserify.require
gulpSrcFiles= require 'gulp-src-files'
files= gulpSrcFiles [
'my_components/**/*.coffee.'
'!my_components/**/*.spec.coffee'
],expose:true
console.log files
###
[
['/path/to/my_components/index.coffee',{expose:'index.coffee'}],
['/path/to/my_components/users.coffee',{expose:'users.coffee'}],
['/path/to/my_components/images.coffee',{expose:'images.coffee'}],
...
]
or custom
gulpSrcFiles= require 'gulp-src-files'
files= gulpSrcFiles [
'my_components/**/*.coffee.'
'!my_components/**/*.spec.coffee'
],expose:(file)->
path= require 'path'
opts=
expose: path.basename file,'.coffee'
[file,opts]
console.log files
###
[
['/path/to/my_components/index.coffee',{expose:'index'}],
['/path/to/my_components/users.coffee',{expose:'users'}],
['/path/to/my_components/images.coffee',{expose:'images'}],
...
]
###
TODO
- Write document for options
License
MIT by 59naga