Brian FitzGerald Brian FitzGerald - 8 days ago 9
Node.js Question

why does npm init actually initialize a grunt project?

I'm trying very hard to understand the Node ecosystem and how npm and its packages work together and I find it very odd that

npm init
initializes a "grunt project" and adds a package.json file to your directory.

Since the node package manager manages many different "packages", I would expect something more like
npm grunt init


Can anyone fill me in on what's going on here and what makes grunt so special that it gets to be the main
npm init
command?

** IMPORTANT NOTE ** after studying and understanding all this a lot better, I would strongly recommend you use neither Grunt NOR Gulp and instead take out the middle man and use npm scripts for your front-end build needs. See this great article by Cory House for more information

Answer

All npm init does is give you prompts (see below) to create a package.json, there's nothing grunt-related that comes with it.

name: (test) 
version: (0.0.0) 
description:
entry point: (index.js) 
test command: 
git repository: 
keywords: 
author: 
license: (BSD) 

Grunt can certainly (and probably should be) installed with npm but it's definitely not part of initializing your package.json.

You can read more about package.json here.

Comments