1 | # grunty
|
2 |
|
3 | > Run any grunt plugin as NPM script without Gruntfile.js
|
4 |
|
5 | [![NPM][grunty-icon] ][grunty-url]
|
6 |
|
7 | [![Build status][grunty-ci-image] ][grunty-ci-url]
|
8 | [![dependencies][grunty-dependencies-image] ][grunty-dependencies-url]
|
9 | [![devdependencies][grunty-devdependencies-image] ][grunty-devdependencies-url]
|
10 |
|
11 | Often I want to run a simple task as NPM script, but hate creating verbose Gruntfile, installing
|
12 | grunt dependencies, etc. Enter **grunty** - just specify the plugin's module, name and any options
|
13 | in the NPM script command. No global grunt installation is necessary.
|
14 |
|
15 | `npm install --save-dev grunty`
|
16 |
|
17 | then use in the `package.json`
|
18 |
|
19 | ```json
|
20 | "scripts": {
|
21 | "concat": "grunty grunt-contrib-concat concat --src=test/a.js,test/b.js --dest=test/out.js",
|
22 | "nice": "grunty grunt-nice-package nice-package"
|
23 | }
|
24 | ```
|
25 |
|
26 | ## Details
|
27 |
|
28 | The plugin runs with the your local `package.json` attached to the config, thus you can use
|
29 | `pkg.name`, `pkg.description` and other properties.
|
30 | If the plugin requires more elaborate options, write `Gruntfile.js`
|
31 |
|
32 | You do need to install the actual plugin and save reference in the `dev` dependencies.
|
33 |
|
34 | Read [Put mock data into Node require cache](http://glebbahmutov.com/blog/put-mock-data-into-node-require-cache/)
|
35 | to learn how this project fakes `gruntfile.js` without actually even saving mock one to disk.
|
36 |
|
37 | ### Small print
|
38 |
|
39 | Author: Gleb Bahmutov © 2015
|
40 |
|
41 | * [@bahmutov](https://twitter.com/bahmutov)
|
42 | * [glebbahmutov.com](http://glebbahmutov.com)
|
43 | * [blog](http://glebbahmutov.com/blog/)
|
44 |
|
45 | License: MIT - do anything with the code, but don't blame me if it does not work.
|
46 |
|
47 | Spread the word: tweet, star on github, etc.
|
48 |
|
49 | Support: if you find any problems with this module, email / tweet /
|
50 | [open issue](https://github.com/bahmutov/grunty/issues) on Github
|
51 |
|
52 | ## MIT License
|
53 |
|
54 | Copyright (c) 2015 Gleb Bahmutov
|
55 |
|
56 | Permission is hereby granted, free of charge, to any person
|
57 | obtaining a copy of this software and associated documentation
|
58 | files (the "Software"), to deal in the Software without
|
59 | restriction, including without limitation the rights to use,
|
60 | copy, modify, merge, publish, distribute, sublicense, and/or sell
|
61 | copies of the Software, and to permit persons to whom the
|
62 | Software is furnished to do so, subject to the following
|
63 | conditions:
|
64 |
|
65 | The above copyright notice and this permission notice shall be
|
66 | included in all copies or substantial portions of the Software.
|
67 |
|
68 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
69 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
70 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
71 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
72 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
73 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
74 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
75 | OTHER DEALINGS IN THE SOFTWARE.
|
76 |
|
77 | [grunty-icon]: https://nodei.co/npm/grunty.png?downloads=true
|
78 | [grunty-url]: https://npmjs.org/package/grunty
|
79 | [grunty-ci-image]: https://travis-ci.org/bahmutov/grunty.png?branch=master
|
80 | [grunty-ci-url]: https://travis-ci.org/bahmutov/grunty
|
81 | [grunty-dependencies-image]: https://david-dm.org/bahmutov/grunty.png
|
82 | [grunty-dependencies-url]: https://david-dm.org/bahmutov/grunty
|
83 | [grunty-devdependencies-image]: https://david-dm.org/bahmutov/grunty/dev-status.png
|
84 | [grunty-devdependencies-url]: https://david-dm.org/bahmutov/grunty#info=devDependencies
|