
Product
Introducing Repository Labels and Security Policies
Socket is introducing a new way to organize repositories and apply repository-specific security policies.
@fomantic/gulp-concat-filenames
Advanced tools
Similar to concat, but creates a file with a list of filenames,not file contents.
Forked Version using updated dependencies
Original repo at https://github.com/the-simian/gulp-concat-filenames
Package | gulp-concat-filenames |
---|---|
Description | Similar to concat, but creates a list of names in the output file, rather than contents being merged. |
Node Version | >= 12 |
var concatFilenames = require('gulp-concat-filenames');
var concatFilenamesOptions = {
};
function fileManifest(){
gulp
.src('./lib/**/*.*')
.pipe(concatFilenames('manifest.txt', concatFilenamesOptions))
.pipe(gulp.dest('./output/'));
}
gulp.task('file-manifest', fileManifest);
###Arguments
Gulp concat-filenames takes 2 arguments: filename
and options
####Filename [Required]
This first argument is the name of the output file the list of filenames will be put into.
#####Options [Optional]
The second argument is optional (pun intended), and is an object with the following properties:
newline
- The character to use in place of \n
for a newline. The default value will be \n
prepend
- Some text to prepend to every entry in the list of filenamesappend
- Some text to append to every intry in the list of filenamestemplate
- a function that takes one parameter (the file name) and returns the string after some formatting. Can be used in addition to, or instead of, append
and prepend
root
- the root folder. Including this argument will return a list of relative paths instead of absolute paths.###Examples
Given the file structure:
.
+-- somefile.txt
+-- lib
| +-- one.txt
| +-- two.txt
+-- gulpfile.js
var concatFilenames = require('gulp-concat-filenames');
var concatFilenamesOptions = {
root: '/lib',
prepend: '==> ',
append: ' <=='
};
function fileManifest(){
gulp
.src('./lib/**/*.*')
.pipe(concatFilenames('manifest.txt', concatFilenamesOptions))
.pipe(gulp.dest('./output/'));
}
gulp.task('file-manifest', fileManifest);
running gulp file-manifest
now produces a file called manifest.txt
with the contents
==> one.txt <==
==> two.txt <==
Or you can use the template property, to format the output as well.
function fileNameFormatter(filename) {
return 'XXX--' + filename.toUpperCase() + '--YYY';
}
var concatFilenames = require('gulp-concat-filenames');
var concatFilenamesOptions = {
root: '/lib',
template: fileNameFormatter // Pass in a function
};
function fileManifest(){
gulp
.src('./lib/**/*.*')
.pipe(concatFilenames('manifest.txt', concatFilenamesOptions))
.pipe(gulp.dest('./output/'));
}
gulp.task('file-manifest', fileManifest);
running gulp file-manifest
now produces a file called manifest.txt
with the contents
XXX--ONE.TXT--YYY
XXX--TWO.TXT--YYY
###Contribution If you write tests, follow semver and have something to add, I love accepting pull requests!! Any questions? Make an issue on github! <3
FAQs
Similar to concat, but creates a file with a list of filenames,not file contents.
The npm package @fomantic/gulp-concat-filenames receives a total of 1,526 weekly downloads. As such, @fomantic/gulp-concat-filenames popularity was classified as popular.
We found that @fomantic/gulp-concat-filenames demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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.
Product
Socket is introducing a new way to organize repositories and apply repository-specific security policies.
Research
Security News
Socket researchers uncovered malicious npm and PyPI packages that steal crypto wallet credentials using Google Analytics and Telegram for exfiltration.
Product
Socket now supports .NET, bringing supply chain security and SBOM accuracy to NuGet and MSBuild-powered C# projects.