pax_global_header00006660000000000000000000000064127534602610014520gustar00rootroot0000000000000052 comment=626fe3bfcff8f61e9dbd011b18681733b336f55b load-grunt-tasks-3.5.2/000077500000000000000000000000001275346026100147265ustar00rootroot00000000000000load-grunt-tasks-3.5.2/.editorconfig000066400000000000000000000002761275346026100174100ustar00rootroot00000000000000root = true [*] indent_style = tab end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [{package.json,*.yml}] indent_style = space indent_size = 2 load-grunt-tasks-3.5.2/.gitattributes000066400000000000000000000000141275346026100176140ustar00rootroot00000000000000* text=auto load-grunt-tasks-3.5.2/.gitignore000066400000000000000000000000151275346026100167120ustar00rootroot00000000000000node_modules load-grunt-tasks-3.5.2/.travis.yml000066400000000000000000000001151275346026100170340ustar00rootroot00000000000000sudo: false language: node_js node_js: - '5' - '4' - '0.12' - '0.10' load-grunt-tasks-3.5.2/gruntfile.js000066400000000000000000000004421275346026100172630ustar00rootroot00000000000000'use strict'; module.exports = function (grunt) { require('./')(grunt, { pattern: ['grunt*'], config: require('./package'), scope: 'devDependencies', requireResolution: true }); grunt.initConfig({ svgmin: { noop: {} } }); grunt.registerTask('default', ['svgmin']); }; load-grunt-tasks-3.5.2/index.js000066400000000000000000000021061275346026100163720ustar00rootroot00000000000000'use strict'; var path = require('path'); var pkgUp = require('pkg-up'); var multimatch = require('multimatch'); var arrify = require('arrify'); var resolvePkg = require('resolve-pkg'); module.exports = function (grunt, opts) { opts = opts || {}; var pattern = arrify(opts.pattern || ['grunt-*', '@*/grunt-*']); var config = opts.config || pkgUp.sync(); var scope = arrify(opts.scope || ['dependencies', 'devDependencies', 'peerDependencies', 'optionalDependencies']); if (typeof config === 'string') { config = require(path.resolve(config)); } pattern.push('!grunt', '!grunt-cli'); var names = scope.reduce(function (result, prop) { var deps = config[prop] || []; return result.concat(Array.isArray(deps) ? deps : Object.keys(deps)); }, []); multimatch(names, pattern).forEach(function (pkgName) { if (opts.requireResolution === true) { try { grunt.loadTasks(resolvePkg(path.join(pkgName, 'tasks'))); } catch (err) { grunt.log.error('npm package "' + pkgName + '" not found. Is it installed?'); } } else { grunt.loadNpmTasks(pkgName); } }); }; load-grunt-tasks-3.5.2/license000066400000000000000000000021371275346026100162760ustar00rootroot00000000000000The MIT License (MIT) Copyright (c) Sindre Sorhus (sindresorhus.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. load-grunt-tasks-3.5.2/package.json000066400000000000000000000015651275346026100172230ustar00rootroot00000000000000{ "name": "load-grunt-tasks", "version": "3.5.2", "description": "Load multiple grunt tasks using globbing patterns", "keywords": [ "dependencies", "glob", "grunt", "load", "match", "matchdep", "pattern", "require", "tasks" ], "license": "MIT", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "files": [ "index.js" ], "repository": "sindresorhus/load-grunt-tasks", "scripts": { "test": "xo && grunt" }, "engines": { "node": ">=0.10.0" }, "dependencies": { "arrify": "^1.0.0", "multimatch": "^2.0.0", "pkg-up": "^1.0.0", "resolve-pkg": "^0.1.0" }, "devDependencies": { "grunt": "^1.0.1", "grunt-cli": "^1.2.0", "grunt-svgmin": "^3.1.0", "xo": "*" }, "peerDependencies": { "grunt": ">=0.4.0" } } load-grunt-tasks-3.5.2/readme.md000066400000000000000000000066201275346026100165110ustar00rootroot00000000000000# load-grunt-tasks [![Build Status](https://travis-ci.org/sindresorhus/load-grunt-tasks.svg?branch=master)](https://travis-ci.org/sindresorhus/load-grunt-tasks) > Load multiple grunt tasks using globbing patterns ---

🔥 Want to strengthen your core JavaScript skills and master ES6?
I would personally recommend this awesome ES6 course by Wes Bos.

--- Usually you would have to load each task one by one, which is unnecessarily cumbersome. This module will read the `dependencies`/`devDependencies`/`peerDependencies`/`optionalDependencies` in your package.json and load grunt tasks that match the provided patterns. #### Before ```js grunt.loadNpmTasks('grunt-shell'); grunt.loadNpmTasks('grunt-sass'); grunt.loadNpmTasks('grunt-recess'); grunt.loadNpmTasks('grunt-sizediff'); grunt.loadNpmTasks('grunt-svgmin'); grunt.loadNpmTasks('grunt-styl'); grunt.loadNpmTasks('grunt-php'); grunt.loadNpmTasks('grunt-eslint'); grunt.loadNpmTasks('grunt-concurrent'); grunt.loadNpmTasks('grunt-bower-requirejs'); ``` #### After ```js require('load-grunt-tasks')(grunt); ``` ## Install ``` $ npm install --save-dev load-grunt-tasks ``` ## Usage ```js // Gruntfile.js module.exports = grunt => { // load all grunt tasks matching the ['grunt-*', '@*/grunt-*'] patterns require('load-grunt-tasks')(grunt); grunt.initConfig({}); grunt.registerTask('default', []); }; ``` ## Examples ### Load all grunt tasks ```js require('load-grunt-tasks')(grunt); ``` Equivalent to: ```js require('load-grunt-tasks')(grunt, {pattern: ['grunt-*', '@*/grunt-*']}); ``` ### Load all grunt-contrib tasks ```js require('load-grunt-tasks')(grunt, {pattern: 'grunt-contrib-*'}); ``` ### Load all grunt-contrib tasks and another non-contrib task ```js require('load-grunt-tasks')(grunt, {pattern: ['grunt-contrib-*', 'grunt-shell']}); ``` ### Load all grunt-contrib tasks excluding one You can exclude tasks using the negate `!` globbing pattern: ```js require('load-grunt-tasks')(grunt, {pattern: ['grunt-contrib-*', '!grunt-contrib-coffee']}); ``` ### Set custom path to package.json ```js require('load-grunt-tasks')(grunt, {config: '../package'}); ``` ### Only load from `devDependencies` ```js require('load-grunt-tasks')(grunt, {scope: 'devDependencies'}); ``` ### Only load from `devDependencies` and `dependencies` ```js require('load-grunt-tasks')(grunt, {scope: ['devDependencies', 'dependencies']}); ``` ### All options in use ```js require('load-grunt-tasks')(grunt, { pattern: 'grunt-contrib-*', config: '../package.json', scope: 'devDependencies', requireResolution: true }); ``` ## Options ### pattern Type: `string`, `array`
Default: `['grunt-*', '@*/grunt-*']` ([globbing pattern](https://github.com/isaacs/minimatch)) ### config Type: `string`, `object`
Default: Path to nearest package.json ### scope Type: `string`, `array`
Default: `['dependencies', 'devDependencies', 'peerDependencies', 'optionalDependencies']`
Values: `'dependencies'`, `'devDependencies'`, `'peerDependencies'`, `'optionalDependencies'`, `'bundledDependencies'` ### requireResolution Type: `boolean`
Default: `false` Traverse up the file hierarchy looking for dependencies like `require()`, rather than the default grunt-like behavior of loading tasks only in the immediate `node_modules` directory. ## License MIT © [Sindre Sorhus](https://sindresorhus.com)