NPM-INIT(3)

πŸ“¦ version 1.2.1, in nixos 26.05, nixpkgs unstable

πŸ’… NAME πŸ’…

okay so bestie, welcome to the NPM-INIT(3) manual page πŸ’– the star of the show is npm, and she's here to help you get your package.json life together. no cap. ✨


πŸŽ€ SYNOPSIS πŸŽ€

npm.commands.init(args, callback)

🌸 DESCRIPTION 🌸

so basically? this will ask you a bunch of questions, and then write a package.json for you. it's giving "guided setup but make it cute" 🫢

it attempts to make reasonable guesses about what you want things to be set to, and then writes a package.json file with the options you've selected. lowkey thoughtful of her. πŸ’…

if you already have a package.json file, it'll read that first, and default to the options in there. so it's not starting from zero β€” it's checking the vibes first. ✨

it is strictly additive, so it does not delete options from your package.json without a really good reason to do so. periodt. it's not out here removing your stuff for fun. πŸ™ˆ

since this function expects to be run on the command-line, it doesn't work very well as a programmatically. 😭 the best option is to roll your own, and since JavaScript makes it stupid simple to output formatted JSON, that is the preferred method. if you're sure you want to handle command-line prompting, then go ahead and use this programmatically. iykyk. πŸ’œ


πŸ¦‹ SEE ALSO πŸ¦‹

  • npm help 5 package.json β€” go read that next, bestie. it's the package.json lore you need. πŸ‘‘

with love and package.json dreams, your NPM-INIT(3) bestie β€” NPM, March 2017 πŸ’–βœ¨

πŸ“¦ where this page comes from