{"_id":"gulp-sort","_rev":"19-a4e32644d1dfe37cfdac8769136d576c","name":"gulp-sort","description":"Sort files in stream by path or any custom sort comparator","dist-tags":{"latest":"2.0.0"},"versions":{"1.0.0":{"name":"gulp-sort","description":"Sort files in stream by path or any custom sort comparator","repository":{"type":"git","url":"https://github.com/pgilad/gulp-sort"},"version":"1.0.0","license":"MIT","author":{"name":"Gilad Peleg","email":"giladp007@gmail.com","url":"http://giladpeleg.com"},"main":"index.js","files":["index.js"],"scripts":{"test":"mocha tests/*.js"},"keywords":["gulpplugin","gulp","sort","paths","order","comparator"],"dependencies":{"through2":"^0.6.3"},"devDependencies":{"gulp-util":"^3.0.1","mocha":"^2.1.0"},"gitHead":"5f1256cec7976429ddc5f8ca545f60666963c0db","bugs":{"url":"https://github.com/pgilad/gulp-sort/issues"},"homepage":"https://github.com/pgilad/gulp-sort","_id":"gulp-sort@1.0.0","_shasum":"7abe7b7f5adffea17770097d107ee5ac2b4aa59e","_from":".","_npmVersion":"2.1.14","_nodeVersion":"0.10.35","_npmUser":{"name":"pgilad","email":"giladp007@gmail.com"},"maintainers":[{"name":"pgilad","email":"giladp007@gmail.com"}],"dist":{"shasum":"7abe7b7f5adffea17770097d107ee5ac2b4aa59e","tarball":"https://registry.npmjs.org/gulp-sort/-/gulp-sort-1.0.0.tgz","integrity":"sha512-zFX0rgx7x4QjvGoPXv0yWaRfUAxNTXcRwGSD82NJ2R1bfdq3bzUZ0hvS2c3jBm7Z5P3h68C6qQ5+poTnyje4mQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCkXOEX/lkDXQIqDktAc3eenpqY3yUOKNsJikIYDrMfcAIhAJpiWEGer1M6opOFbXduNknuEl8xnWQ8Fm/8rj+4+wBT"}]},"directories":{}},"1.0.1":{"name":"gulp-sort","description":"Sort files in stream by path or any custom sort comparator","repository":{"type":"git","url":"https://github.com/pgilad/gulp-sort"},"version":"1.0.1","license":"MIT","author":{"name":"Gilad Peleg","email":"giladp007@gmail.com","url":"http://giladpeleg.com"},"main":"index.js","files":["index.js"],"scripts":{"test":"mocha tests/*.js"},"keywords":["gulpplugin","gulp","sort","paths","order","comparator"],"dependencies":{"through2":"^0.6.3"},"devDependencies":{"gulp-util":"^3.0.1","mocha":"^2.1.0"},"gitHead":"597dc99de21e6d89d74df3de80c25586732eb2db","bugs":{"url":"https://github.com/pgilad/gulp-sort/issues"},"homepage":"https://github.com/pgilad/gulp-sort","_id":"gulp-sort@1.0.1","_shasum":"6d3ae646f7ae6c926d1bcee894ff04bb84d950bb","_from":".","_npmVersion":"2.1.18","_nodeVersion":"0.10.35","_npmUser":{"name":"pgilad","email":"giladp007@gmail.com"},"maintainers":[{"name":"pgilad","email":"giladp007@gmail.com"}],"dist":{"shasum":"6d3ae646f7ae6c926d1bcee894ff04bb84d950bb","tarball":"https://registry.npmjs.org/gulp-sort/-/gulp-sort-1.0.1.tgz","integrity":"sha512-WukPPCmH0xKHk8asMiQqfLF1yqiJKIgvWg5Rr13r1qTy/UtvM0gE7RhtkrHaXz3dNghvCiH9X80ZVVNOeR2ZxA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD3HdbORCm1mFS2llk6Ts0T81EhNCXMwFbSIKnR0oSSkwIhAMFkcAbq0xfGZWFROXU37R9tEBh7H1C+08y7AVPcRGah"}]},"directories":{}},"1.1.0":{"name":"gulp-sort","description":"Sort files in stream by path or any custom sort comparator","repository":{"type":"git","url":"https://github.com/pgilad/gulp-sort"},"version":"1.1.0","license":"MIT","author":{"name":"Gilad Peleg","email":"giladp007@gmail.com","url":"http://giladpeleg.com"},"main":"index.js","files":["index.js"],"scripts":{"test":"mocha tests/*.js"},"keywords":["gulpplugin","gulp","sort","paths","order","comparator"],"dependencies":{"through2":"^0.6.5"},"devDependencies":{"gulp-util":"^3.0.4","mocha":"^2.1.0"},"gitHead":"8ce6c87cdc8d546b3b593e0bec7d8db8ad721d18","bugs":{"url":"https://github.com/pgilad/gulp-sort/issues"},"homepage":"https://github.com/pgilad/gulp-sort","_id":"gulp-sort@1.1.0","_shasum":"e64cf64c872a9d4227cee5efab88a7aa4727bb05","_from":".","_npmVersion":"2.7.5","_nodeVersion":"0.12.2","_npmUser":{"name":"pgilad","email":"giladp007@gmail.com"},"maintainers":[{"name":"pgilad","email":"giladp007@gmail.com"}],"dist":{"shasum":"e64cf64c872a9d4227cee5efab88a7aa4727bb05","tarball":"https://registry.npmjs.org/gulp-sort/-/gulp-sort-1.1.0.tgz","integrity":"sha512-BZ2jkDyqqd5K40CFZVfUYoEfnmcJuUSLZYCav20D/f32Mahy9Z1nMK7GMr/4XLshenFlUd7SObq7XkTfWQPu0w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIESWqMq4maIbot3yYKNDUYObRlu7EQqdiD1MP0p2EWZlAiBP3V4hpusjoqhHDUfRwxtru3qw20jdzekIGUIYlB91Yw=="}]},"directories":{}},"1.1.1":{"name":"gulp-sort","description":"Sort files in stream by path or any custom sort comparator","repository":{"type":"git","url":"https://github.com/pgilad/gulp-sort"},"version":"1.1.1","license":"MIT","author":{"name":"Gilad Peleg","email":"giladp007@gmail.com","url":"http://giladpeleg.com"},"main":"index.js","files":["index.js"],"scripts":{"test":"mocha tests/*.js"},"keywords":["gulpplugin","gulp","sort","paths","order","comparator"],"dependencies":{"through2":"^0.6.5"},"devDependencies":{"gulp-util":"^3.0.4","mocha":"^2.1.0"},"gitHead":"ef4e7f38b8dce445ef25e39879d5ba4553844814","bugs":{"url":"https://github.com/pgilad/gulp-sort/issues"},"homepage":"https://github.com/pgilad/gulp-sort","_id":"gulp-sort@1.1.1","_shasum":"4bb1700d08c16c86c6622ff9cb57358151c19f19","_from":".","_npmVersion":"2.7.5","_nodeVersion":"0.12.2","_npmUser":{"name":"pgilad","email":"giladp007@gmail.com"},"maintainers":[{"name":"pgilad","email":"giladp007@gmail.com"}],"dist":{"shasum":"4bb1700d08c16c86c6622ff9cb57358151c19f19","tarball":"https://registry.npmjs.org/gulp-sort/-/gulp-sort-1.1.1.tgz","integrity":"sha512-b5dT+/T84kCaQPeyhjrNtYRl7n5AmpSIG6lbJhPb68Ih+1HuMFY6zrjaOJoAJ3qtJJO6ohv9TzXXgPyWvfXAOA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF9QxId5wFkkQWVqEiLp9Y3g2sh+IwBDi7QfXASDoNp8AiEA97DAp6udH1c7/b+B6e3Hc4BkNP1mZOqDIM6FcP/q2Yg="}]},"directories":{}},"2.0.0":{"name":"gulp-sort","description":"Sort files in stream by path or any custom sort comparator","repository":{"type":"git","url":"git+https://github.com/pgilad/gulp-sort.git"},"version":"2.0.0","license":"MIT","author":{"name":"Gilad Peleg","email":"giladp007@gmail.com","url":"http://giladpeleg.com"},"main":"index.js","files":["index.js"],"scripts":{"test":"mocha tests/*.js"},"keywords":["gulpplugin","gulp","sort","paths","order","comparator"],"dependencies":{"through2":"^2.0.1"},"devDependencies":{"gulp-util":"^3.0.4","mocha":"^2.1.0","stable":"^0.1.5"},"gitHead":"720d3efaec97ebfbd11d67540c684e5a916e4262","bugs":{"url":"https://github.com/pgilad/gulp-sort/issues"},"homepage":"https://github.com/pgilad/gulp-sort#readme","_id":"gulp-sort@2.0.0","_shasum":"c6762a2f1f0de0a3fc595a21599d3fac8dba1aca","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.5.0","_npmUser":{"name":"pgilad","email":"giladp007@gmail.com"},"dist":{"shasum":"c6762a2f1f0de0a3fc595a21599d3fac8dba1aca","tarball":"https://registry.npmjs.org/gulp-sort/-/gulp-sort-2.0.0.tgz","integrity":"sha512-MyTel3FXOdh1qhw1yKhpimQrAmur9q1X0ZigLmCOxouQD+BD3za9/89O+HfbgBQvvh4igEbp0/PUWO+VqGYG1g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE0jxTfdUnm1/yK4LYdiznt0ydsO4lVKXeZVsYl51BWlAiEAxfCZLH3HgydrB7yuDhJXfKStuXlwQRhEyHJm+bGCc68="}]},"maintainers":[{"name":"pgilad","email":"giladp007@gmail.com"}],"_npmOperationalInternal":{"host":"packages-9-west.internal.npmjs.com","tmp":"tmp/gulp-sort-2.0.0.tgz_1455533389741_0.5248277480714023"},"directories":{}}},"readme":"# [gulp](https://github.com/wearefractal/gulp)-sort\n> Sort files in stream by path or any custom sort comparator\n\n[![Build Status](http://img.shields.io/travis/pgilad/gulp-sort/master.svg?style=flat)](https://travis-ci.org/pgilad/gulp-sort)\n\n## Install\n\n`$ npm install gulp-sort --save-dev`\n\n## Usage\n\n```js\nvar sort = require('gulp-sort');\n\n// default sort\ngulp.src('./src/js/**/*.js')\n    .pipe(sort())\n    .pipe(gulp.dest('./build/js'));\n\n// pass in a custom comparator function\ngulp.src('./src/js/**/*.js')\n    .pipe(sort(customComparator))\n    .pipe(gulp.dest('./build/js'));\n\n// sort descending\ngulp.src('./src/js/**/*.js')\n    .pipe(sort({\n         asc: false\n    }))\n    .pipe(gulp.dest('./build/js'));\n\n// sort with a custom comparator\ngulp.src('./src/js/**/*.js')\n    .pipe(sort({\n        comparator: function(file1, file2) {\n            if (file1.path.indexOf('build') > -1) {\n                return 1;\n            }\n            if (file2.path.indexOf('build') > -1) {\n                return -1;\n            }\n            return 0;\n        }\n    }))\n    .pipe(gulp.dest('./build/js'));\n\n// sort with a custom sort function\nvar stable = require('stable');\ngulp.src('./src/js/**/*.js')\n    .pipe(sort({\n        customSortFn: function(files, comparator) {\n            return stable(files, comparator);\n        }\n    }))\n    .pipe(gulp.dest('./build/js'));\n```\n\n## Options\n\n`gulp-sort` takes in an optional [comparator](#comparator) function, or dictionary with following params:\n\n### asc\n\nSort ascending. Defaults to true. Specify false to sort descending.\n\n### comparator\n\nComparator function to use. `comparator(file1, file2)`. Defaults to `localeCompare` of file paths.\n\n### customSortFn\n\nUse `customSortFn` in order to control the sorting yourself (useful for stable sorts).\n\n`customSortFn` signature is as follows:\n\n`customSortFn(<files>, <comparator>)`\n\n- `files` being the vinyl file objects that were passed in\n- `comparator` is the default comparator used, or a custom one that was passed as param\n\nThis function is expected to return back the sorted list of files.\n\n## License\n\nMIT ©[Gilad Peleg](http://giladpeleg.com)\n","maintainers":[{"name":"pgilad","email":"giladp007@gmail.com"}],"time":{"modified":"2022-06-18T18:00:09.761Z","created":"2015-01-03T16:43:41.521Z","1.0.0":"2015-01-03T16:43:41.521Z","1.0.1":"2015-01-27T19:58:35.204Z","1.1.0":"2015-05-08T19:02:01.230Z","1.1.1":"2015-05-14T22:16:49.039Z","2.0.0":"2016-02-15T10:49:53.277Z"},"homepage":"https://github.com/pgilad/gulp-sort#readme","keywords":["gulpplugin","gulp","sort","paths","order","comparator"],"repository":{"type":"git","url":"git+https://github.com/pgilad/gulp-sort.git"},"author":{"name":"Gilad Peleg","email":"giladp007@gmail.com","url":"http://giladpeleg.com"},"bugs":{"url":"https://github.com/pgilad/gulp-sort/issues"},"license":"MIT","readmeFilename":"README.md","users":{"pgilad":true,"edwin_estrada":true,"sergey-geek":true,"tdmalone":true,"v8xm":true,"ccd3v":true,"webfacer":true}}