Reputation: 912
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
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
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
Upvotes: 0