
Security News
New CNA Scorecard Tool Ranks CVE Data Quality Across the Ecosystem
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.
gobble-concat
Advanced tools
Concatenate files with gobble.
First, you need to have gobble installed - see the gobble readme for details. Then,
npm i -D gobble-concat
gobblefile.js
var gobble = require( 'gobble' );
module.exports = gobble( 'js' ).transform( 'concat', { dest: 'bundle.js' });
The dest
property is required. Other values - files
, sort
, separator
and writeSourcemap
, explained below - are optional.
files
You can specify which files are included, and their order, like so:
var gobble = require( 'gobble' );
module.exports = gobble( 'js' )
.transform( 'concat', {
dest: 'bundle.js',
files: [ 'foo.js', 'bar.js', 'baz.js' ]
});
The files
option can be a minimatch pattern:
var gobble = require( 'gobble' );
module.exports = gobble( 'js' )
.transform( 'concat', {
dest: 'bundle.js',
files: [ 'vendor/**/*.js', 'src/**/*.js' ]
});
sort
Within each pattern, if multiple files are found, they will be sorted alphabetically by default. You can override this by passing a sort
option, which is a standard compare function].
If files match multiple patterns, they will only be included once (upon the first match).
separator
By default, files will be separated by newlines. You can change this to be any string:
var gobble = require( 'gobble' );
module.exports = gobble( 'js' )
.transform( 'concat', {
dest: 'bundle.js',
separator: '/* YOLO */'
});
writeSourcemap
Concatenating javascript or CSS files requires some extra handling of their sourcemaps, specially in complex workflows. With this option set to true
, the sourcemaps of the files to be concatenated will be parsed, files with no sourcemap will be assigned an identity (1:1) sourcemap, and a new sourcemap will be generated from all of them.
The default value is true
when dest
is a file with a .js
or .css
extension, and false
otherwise.
MIT. Copyright 2014 Rich Harris
"THE BEER-WARE LICENSE": ivan@sanchezortega.es wrote this file. As long as you retain this notice you can do whatever you want with this stuff. If we meet some day, and you think this stuff is worth it, you can buy me a beer in return.
0.4.1
FAQs
Concatenate files with gobble
The npm package gobble-concat receives a total of 0 weekly downloads. As such, gobble-concat popularity was classified as not popular.
We found that gobble-concat 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
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.
Research
/Security News
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.
Research
/Security News
Socket uncovered 11 malicious Go packages using obfuscated loaders to fetch and execute second-stage payloads via C2 domains.