Ahmed Mohamed
Ahmed Mohamed

Reputation: 13

Why do we use npm init command in any new project?

In my travel in learning Front End Development I started with creating simple projects with three files (JavaScript file, HTML file, CSS file). But now I find that in any project I should create new files with npm init command which makes JSON file and a lot of folders like dist and others. The thing that I can't Understand is why I should create this JSON file? The other thing is I find that Gulp is a task runner, but why when I install Sass for example I should type gulp install gulp-sass and not npm install gulp-sass because npm is the package manager and responsible for installing packages not gulp. Can anyone help me?

Upvotes: 1

Views: 8245

Answers (1)

Becki
Becki

Reputation: 21

Essentially, the package.JSON file is the heart of your NPM project. Theres a really good article here on understanding the file: https://heynode.com/tutorial/what-packagejson/#:~:text=json%20file%20is%20the%20heart,entry%20point%20to%20our%20package.

It is what allows your NPM project to run, shows any dependencies, has the metadata for it etc.

Upvotes: 1

Related Questions