Grunt (software)

Uses your system voice; voice and rate in settings.

Snapshot

≈ 2 min read

Names in other languages

No names in other languages are held for this entry yet.

Article bodies are English and are not machine-translated. A name in another language is not a translation of the article.

Grunt is a JavaScript task runner, a tool used to automatically perform frequent tasks such as minification, compilation, unit testing, and linting. It uses a command-line interface to run custom tasks defined in a file (known as a Gruntfile). Grunt was created by Ben Alman and is written in Node.js. It is distributed via npm. As of October 2022, there were more than 6,000 plugins available in the Grunt ecosystem. Companies and projects that use Grunt include Adobe Systems, jQuery, Twitter, Mozilla, Bootstrap, Cloudant, Opera, WordPress, Walmart, and Microsoft.

Grunt is a JavaScript task runner, a tool used to automatically perform frequent tasks such as minification, compilation, unit testing, and linting. It uses a command-line interface to run custom tasks defined in a file (known as a Gruntfile). Grunt was created by Ben Alman and is written in Node.js. It is distributed via npm. As of October 2022, there were more than 6,000 plugins available in the Grunt ecosystem. Companies and projects that use Grunt include Adobe Systems, jQuery, Twitter, Mozilla, Bootstrap, Cloudant, Opera, WordPress, Walmart, and Microsoft. module.exports = function(grunt) { // Task configuration grunt.initConfig({ taskName1: 'Task1 Configuration', taskName2: 'Task2 Configuration' }); // Loads plugins grunt.loadNpmTasks('pluginName1'); grunt.loadNpmTasks('pluginName2'); // Custom tasks grunt.registerTask('customTaskName1', 'Custom task description', function(taskParameter) { // Custom statements }); // Combining multiple tasks to a single task grunt.registerTask('customTaskName2', ['taskName1', 'customTaskName1']); // Default task - runs if task name is not specified grunt.registerTask('default', ['customTaskName2']); }; In the above example, executing the grunt command will run which has been defined above as a combination of both and .

See also

Node.js Build automation List of build automation software Apache Maven Yeoman (computing) Modernizr JavaScript framework JavaScript library

Further reading

Text derived from https://en.wikipedia.org/w/index.php?oldid=1276249733 under CC BY-SA 4.0; modifications have been made.

Sources cited in this revision

6 named source(s) extracted from the cited revision. A source with no author is shown by its publication; nothing is invented.