Danish
Danish

Reputation: 912

What is meaning of the following line in NPM?

npm init -y

I'm using above line to create node package.json file for my node project using Node Package Manager. But I want to know about -y.

What does it do?

Upvotes: 2

Views: 72

Answers (2)

Oleksii
Oleksii

Reputation: 1643

If you will run init command with this flag you will get default package.json file. Take a look at documentation.

Upvotes: 1

Arif Rathod
Arif Rathod

Reputation: 703

If the initializer is omitted (by just calling npm init), init will fall back to legacy init behavior. It will ask you a bunch of questions, and then write a package.json for you. It will attempt to make reasonable guesses based on existing fields, dependencies, and options selected. It is strictly additive, so it will keep any fields and values that were already set. You can also use -y/--yes to skip the questionnaire altogether. If you pass --scope, it will create a scoped package.

read doc here. here already mentioned all the things about npm init

npm init doc

Upvotes: 0

Related Questions