Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gulp-order

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-order

The gulp plugin `gulp-order` allows you to reorder a stream of files using the same syntax as of `gulp.src`.

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
19K
decreased by-6.17%
Maintainers
1
Weekly downloads
 
Created
Source

gulp-order

The gulp plugin gulp-order allows you to reorder a stream of files using the same syntax as of gulp.src.

Motivation

Assume you want to concatenate the following files in the given order (with gulp-concat):

  • vendor/js1.js
  • vendor/**/*.{coffee,js}
  • app/coffee1.coffee
  • app/**/*.{coffee,js}

You'll need two streams:

  • A stream that emits the JavaScript files, and
  • a stream that emits the compiled CoffeeScript files.

To combine the streams you can use es.merge (from event-stream) but you'll notice that es.merge just emits the files in the same order as they come in. This can be quite random. With gulp-order you can reorder the files.

Usage

require("gulp-order") returns a function that takes an array of patterns (as gulp.src would take).

var order = require("gulp-order");
var es = require("event-stream");
var concat = require("gulp-concat");

var coffeeFiles = gulp.src("**/*.coffee");
var jsFiles = gulp.src("**/*.js");

es
  .merge(coffeeFiles, jsFiles)
  .pipe(order([
    "vendor/js1.js",
    "vendor/**/*.js",
    "app/coffee1.js",
    "app/**/*.js"
  ]))
  .pipe(concat("all.js"))
  .pipe(gulp.dest("dist"));

Features

Uses minimatch for matching.

Tips

  • Try to move your ordering out of your gulp.src(...) calls into order(...) instead.

Contributors

License

MIT - Copyright © 2014 Marcel Jackwerth

FAQs

Package last updated on 18 Feb 2014

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc