motion
Version:
motion - moving development forward
73 lines (72 loc) • 6.92 kB
JSON
{
"_args": [
[
"gulp-ignore@https://registry.npmjs.org/gulp-ignore/-/gulp-ignore-2.0.1.tgz",
"/Users/nw/flint/packages/flint"
]
],
"_from": "gulp-ignore@2.0.1",
"_id": "gulp-ignore@2.0.1",
"_inCache": true,
"_location": "/gulp-ignore",
"_phantomChildren": {},
"_requested": {
"name": "gulp-ignore",
"raw": "gulp-ignore@https://registry.npmjs.org/gulp-ignore/-/gulp-ignore-2.0.1.tgz",
"rawSpec": "https://registry.npmjs.org/gulp-ignore/-/gulp-ignore-2.0.1.tgz",
"scope": null,
"spec": "https://registry.npmjs.org/gulp-ignore/-/gulp-ignore-2.0.1.tgz",
"type": "remote"
},
"_requiredBy": [
"/"
],
"_resolved": "https://registry.npmjs.org/gulp-ignore/-/gulp-ignore-2.0.1.tgz",
"_shasum": "e2ec217b53fccee472bbddbe7d1dc11fffa0ef68",
"_shrinkwrap": null,
"_spec": "gulp-ignore@https://registry.npmjs.org/gulp-ignore/-/gulp-ignore-2.0.1.tgz",
"_where": "/Users/nw/flint/packages/flint",
"author": {
"name": "Rob Richardson",
"url": "http://robrich.org/"
},
"bugs": {
"url": "https://github.com/robrich/gulp-ignore/issues"
},
"dependencies": {
"gulp-match": "^1.0.0",
"through2": "^2.0.0"
},
"description": "Include or exclude gulp files from the stream based on a condition",
"devDependencies": {
"jshint": "^2.8.0",
"mocha": "^2.3.3",
"should": "^7.1.0"
},
"engines": {
"node": ">= 0.10.0"
},
"homepage": "https://github.com/robrich/gulp-ignore",
"keywords": [
"exclude",
"filter",
"gulp-filter",
"gulpplugin",
"include",
"minimatch"
],
"license": "MIT",
"main": "./index.js",
"name": "gulp-ignore",
"optionalDependencies": {},
"readme": "gulp-ignore \r\n===========\r\n\r\nInclude or exclude [gulp](https://github.com/gulpjs/gulp) files from the stream based on a condition\r\n\r\nUsage\r\n\r\n1: Exclude things from the stream\r\n\r\n**Exclude things from entering the stream**\r\n\r\n![][glob]\r\n\r\n```javascript\r\nvar uglify = require('gulp-uglify');\r\n\r\ngulp.task('task', function() {\r\n gulp.src(['./**/*.js', '!./node_modules/**'])\r\n .pipe(uglify())\r\n .pipe(gulp.dest('./dist/'));\r\n});\r\n```\r\n\r\nGrab all JavaScript files that aren't in the node_modules folder, uglify them, and write them.\r\nThis is fastest because nothing in node_modules ever leaves `gulp.src()`\r\n\r\n\r\n2: Remove things from the stream\r\n\r\n**Remove from here on**\r\n\r\n![][exclude]\r\n\r\n```javascript\r\nvar gulpIgnore = require('gulp-ignore');\r\nvar uglify = require('gulp-uglify');\r\nvar jshint = require('gulp-jshint');\r\n\r\nvar condition = './gulpfile.js';\r\n\r\ngulp.task('task', function() {\r\n gulp.src('./**/*.js')\r\n .pipe(jshint())\r\n .pipe(gulpIgnore.exclude(condition))\r\n .pipe(uglify())\r\n .pipe(gulp.dest('./dist/'));\r\n});\r\n```\r\n\r\nRun JSHint on everything, remove gulpfile from the stream, then uglify and write everything else.\r\n\r\n3: Filter only matching things\r\n\r\n**Include from here on**\r\n\r\n![][include]\r\n\r\n```javascript\r\nvar gulpIgnore = require('gulp-ignore');\r\nvar uglify = require('gulp-uglify');\r\nvar jshint = require('gulp-jshint');\r\n\r\nvar condition = './public/**.js';\r\n\r\ngulp.task('task', function() {\r\n gulp.src('./**/*.js')\r\n .pipe(jshint())\r\n .pipe(gulpIgnore.include(condition))\r\n .pipe(uglify())\r\n .pipe(gulp.dest('./dist/'));\r\n});\r\n```\r\n\r\nRun JSHint on everything, filter to include only files from in the public folder, then uglify and write them.\r\n\r\n\r\n4: Conditionally filter content, include everything down-stream\r\n\r\n**Condition**\r\n\r\n![][condition]\r\n\r\n```javascript\r\nvar gulpif = require('gulp-if');\r\nvar uglify = require('gulp-uglify');\r\n\r\nvar condition = true; // TODO: add business logic\r\n\r\ngulp.task('task', function() {\r\n gulp.src('./src/*.js')\r\n .pipe(gulpif(condition, uglify()))\r\n .pipe(gulp.dest('./dist/'));\r\n});\r\n```\r\nOnly uglify the content if the condition is true, but send all the files to the dist folder\r\n\r\n\r\nAPI\r\n---\r\n\r\n### exclude(condition [, minimatchOptions])\r\n\r\nExclude files whose `file.path` matches, include everything else\r\n\r\n### include(condition [, minimatchOptions])\r\n\r\nInclude files whose `file.path` matches, exclude everything else\r\n\r\n### condition\r\n\r\nType: `boolean` or [`stat`](http://nodejs.org/api/fs.html#fs_class_fs_stats) object or `function` that takes in a vinyl file and returns a boolean or `RegularExpression` that works on the `file.path`\r\n\r\nThe condition parameter is any of the conditions supported by [gulp-match](https://github.com/robrich/gulp-match). The `file.path` is passed into `gulp-match`.\r\n\r\nIf a function is given, then the function is passed a vinyl `file`. The function should return a `boolean`.\r\n\r\n##### minimatchOptions\r\n\r\nOptional, if it's a glob condition, these options are passed to [https://github.com/isaacs/minimatch](minimatch).\r\n\r\n\r\nLICENSE\r\n-------\r\n\r\n(MIT License)\r\n\r\nCopyright (c) 2014 [Richardson & Sons, LLC](http://richardsonandsons.com/)\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining\r\na copy of this software and associated documentation files (the\r\n\"Software\"), to deal in the Software without restriction, including\r\nwithout limitation the rights to use, copy, modify, merge, publish,\r\ndistribute, sublicense, and/or sell copies of the Software, and to\r\npermit persons to whom the Software is furnished to do so, subject to\r\nthe following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be\r\nincluded in all copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n\r\n[condition]: https://rawgithub.com/robrich/gulp-ignore/master/img/condition.svg\r\n[ternary]: https://rawgithub.com/robrich/gulp-ignore/master/img/ternary.svg\r\n[exclude]: https://rawgithub.com/robrich/gulp-ignore/master/img/exclude.svg\r\n[include]: https://rawgithub.com/robrich/gulp-ignore/master/img/include.svg\r\n[glob]: https://rawgithub.com/robrich/gulp-ignore/master/img/glob.svg\r\n",
"readmeFilename": "README.md",
"repository": {
"type": "git",
"url": "git://github.com/robrich/gulp-ignore.git"
},
"scripts": {
"test": "mocha && jshint ."
},
"version": "2.0.1"
}