Exciting release!Introducing "safe npm". Learn more
Socket
Log inDemoInstall

grunt-file-order

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Issues
File Explorer

Advanced tools

grunt-file-order

Helpers for ordering files

    1.0.0latest
    npm

Version published
Maintainers
1
Weekly downloads
502
increased by3.08%

Weekly downloads

Readme

Source

grunt-file-order

A grunt extension for ordering files after selection.
Adds order attribute to both config files and grunt.file.expand.

Installation

$ npm install --save grunt-file-order

Usage

In config files
require('grunt-file-order'); // global addition to grunt module.exports = function (grunt, options) { return { copyFiles: { files: [ { expand: true, src: ['<%= sourcedir %>**'], dest: '<%= outputdir %>', order: function(filepaths) { // sort alphabetically return filepaths.sort(function(a,b) { return a>b ? 1 : a<b ? -1 : 0; }); } } ] } }; };
In task grunt.file.expand
require('grunt-file-order'); // global addition to grunt var sourcedir = "./src"; var files = grunt.file.expand({ order: function(filepaths) { // sort alphabetically return filepaths.sort(function(a,b) { return a>b ? 1 : a<b ? -1 : 0; }); } }, sourcedir);

FAQs

Last updated on 09 Oct 2017

Did you know?

Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install Socket
Socket
support@socket.devSocket SOC 2 Logo

Product

  • Package Issues
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc