22

Please I would love to know the meaning of the flag -y. I noticed it is used in setting up an npm project, but what exactly does it mean?

npm init -y
Penny Liu
  • 15,447
  • 5
  • 79
  • 98
George Foreman
  • 349
  • 1
  • 2
  • 6

2 Answers2

28

The -y flag when passed to NPM commands tells the generator to use the defaults instead of asking questions.

npm init -y

will simply generate an empty npm project without going through an interactive process.

The -y stands for yes. More about npm-init here

Penny Liu
  • 15,447
  • 5
  • 79
  • 98
sheR
  • 387
  • 2
  • 8
6

from npm help init:

   Generate it without having it ask any questions:

     $ npm init -y
Evert
  • 93,428
  • 18
  • 118
  • 189