npm init #131

isaacs opened this Issue Jul 28, 2010 · 1 comment


None yet
1 participant

isaacs commented Jul 28, 2010

Give the user a few prompts, and then write a package.json file. If there is a package.json file, then that file provides the defaults for each option rather than the defaults suggested below.

Have some way for the user to type HELP or something at any point to show some helpful text on that field.

  • What is your package name? [default to current directory name, but with node- and -js stripped]
  • What is a description of your program?
  • What version is it? [default to git describe --tags, if that works, or 0.0.0 if it doesn't]
  • What is the main module? [default is none]
  • How do you start your program? [default to none]
  • What packages does your program use? If the user types just a name, then look up the available versions and let them pick one, or a range, or "any", and then have an option for "done" when they're done assigning dependencies.
  • How do you run your program's tests? [default to none]

At the end, write the package.json with JSON.stringify(data, null, 2) so that it's somewhat readable. (Sadly, no easy way to write comma-first JSON, unless we include my textmate pretty-printer with npm, which seems silly.)

This comment has been minimized.

Show comment Hide comment

isaacs Oct 22, 2010


Implemented on 85769c5


isaacs commented Oct 22, 2010

Implemented on 85769c5

bmeck pushed a commit to bmeck/npm that referenced this issue Dec 20, 2011

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment