You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

gobble-concat

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gobble-concat

Concatenate files with gobble

0.4.1
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

gobble-concat

Concatenate files with gobble.

Installation

First, you need to have gobble installed - see the gobble readme for details. Then,

npm i -D gobble-concat

Usage

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.

License

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.

Keywords

gobble-plugin

FAQs

Package last updated on 18 Oct 2016

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.