
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
gulp-filelist
Advanced tools
Output list of files in current stream to JSON file or custom format.
Add to your Node.js dev dependencies:
npm install --savedev gulp-filelist
Add it to your gulp file:
gulp
.src(['awesome.file', 'lame.file'])
.pipe(require('gulp-filelist')('filelist.json'))
.pipe(gulp.dest('out'))
Outputs out/filelist.json
:
[
"awesome.file",
"lame.file"
]
$ npm install gulp-filelist
{ absolute: true }
gulp
.src(['awesome.file', 'lame.file'])
.pipe(require('gulp-filelist')('filelist.json', { absolute: true }))
.pipe(gulp.dest('out'))
Outputs:
[
"/Users/chris/my-project/out/awesome.file",
"/Users/chris/my-project/out/lame.file"
]
{ relative: true }
gulp
.src(['awesome.file', 'lame.file'])
.pipe(require('gulp-rename')(function(path) { path.dirname = 'foo' }))
.pipe(require('gulp-filelist')('filelist.json', { relative: true }))
.pipe(gulp.dest('out'))
Outputs:
[
"foo/awesome.file",
"foo/lame.file"
]
{ flatten: true }
gulp
.src(['awesome.file', 'lame.file'])
.pipe(require('gulp-filelist')('filelist.json', { flatten: true }))
.pipe(gulp.dest('out'))
Outputs:
[
"awesome.file",
"lame.file"
]
{ removeExtensions: true }
gulp
.src(['directory/awesome.file', 'directory/lame.file'])
.pipe(require('gulp-filelist')('filelist.json', { removeExtensions: true }))
.pipe(gulp.dest('out'))
Outputs:
[
"directory/awesome",
"directory/lame"
]
{ destRowTemplate: <rowStringTemplate | function> }
usage with string template
gulp
.src(['directory/awesome.file', 'directory/lame.file'])
.pipe(require('gulp-filelist')('filelist.json', { destRowTemplate: "/// <amd dependency='@filePath@'/>" }))
.pipe(gulp.dest('out'))
Outputs:
[
"/// <amd dependency='directory/awesome'/>",
"/// <amd dependency='directory/lame'/>"
]
usage with formatter function
function formatter(filePath) {
return filePath.substring(filePath.lastIndexOf('/') + 1) + ': ' + filePath + '\r\n';
}
gulp
.src(['directory/awesome.file', 'directory/lame.file'])
.pipe(require('gulp-filelist')('filelist.json', { destRowTemplate: formatter }))
.pipe(gulp.dest('out'))
Outputs:
[
"awesome: directory/awesome",
"lame: directory/lame"
]
FAQs
Output list of files in current stream to JSON file or custom format.
The npm package gulp-filelist receives a total of 2,704 weekly downloads. As such, gulp-filelist popularity was classified as popular.
We found that gulp-filelist demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.