UNPKG

3.4 kBMarkdownView Raw
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
11Often I want to run a simple task as NPM script, but hate creating verbose Gruntfile, installing
12grunt dependencies, etc. Enter **grunty** - just specify the plugin's module, name and any options
13in the NPM script command. No global grunt installation is necessary.
14
15`npm install --save-dev grunty`
16
17then 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
28The plugin runs with the your local `package.json` attached to the config, thus you can use
29`pkg.name`, `pkg.description` and other properties.
30If the plugin requires more elaborate options, write `Gruntfile.js`
31
32You do need to install the actual plugin and save reference in the `dev` dependencies.
33
34Read [Put mock data into Node require cache](http://glebbahmutov.com/blog/put-mock-data-into-node-require-cache/)
35to learn how this project fakes `gruntfile.js` without actually even saving mock one to disk.
36
37### Small print
38
39Author: Gleb Bahmutov © 2015
40
41* [@bahmutov](https://twitter.com/bahmutov)
42* [glebbahmutov.com](http://glebbahmutov.com)
43* [blog](http://glebbahmutov.com/blog/)
44
45License: MIT - do anything with the code, but don't blame me if it does not work.
46
47Spread the word: tweet, star on github, etc.
48
49Support: 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
54Copyright (c) 2015 Gleb Bahmutov
55
56Permission is hereby granted, free of charge, to any person
57obtaining a copy of this software and associated documentation
58files (the "Software"), to deal in the Software without
59restriction, including without limitation the rights to use,
60copy, modify, merge, publish, distribute, sublicense, and/or sell
61copies of the Software, and to permit persons to whom the
62Software is furnished to do so, subject to the following
63conditions:
64
65The above copyright notice and this permission notice shall be
66included in all copies or substantial portions of the Software.
67
68THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
69EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
70OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
71NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
72HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
73WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
74FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
75OTHER 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