N
N
ndsdmfwg2014-01-22 07:12:18
Node.js
ndsdmfwg, 2014-01-22 07:12:18

What is the difference between grunt and grunt-cli?

I want to put grunt, I read a couple of interesting features of it the other day. What is the difference between grunt and grunt-cli?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Kirill Chernyshov, 2014-01-22
@ndsdmfwg

grunt-cli (grunt-command-line-interface) is just a way to run grunt-task from the console
grunt is the main package with basic tasks
To work correctly you need to install both, but if grunt-cli must be installed globally in system (npm install -g grunt-cli), it is better to install grunt locally relative to the project to bind to a specific version of grunt.
For example - in the root of the project, create the package.json file (echo '{}' > package.json), then install grunt (npm install grunt --save), --save indicates that the package should be saved in the package.json file and set the version installed package.
package.json will contain the following lines:

{
  "dependencies": {
    "grunt": "~0.4.2"
  }
}

Now grunt-cli will look in the current node_modules/grunt directory and work with the version installed locally for the project.

A
aen, 2014-01-22
@aen

grunt-cli is a command line interface that allows you to work with grunt in the console (terminal).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question