sindresorhus / generator-nm

Scaffold out a node module
MIT License
743 stars 82 forks source link

Prompt for module description #57

Closed radiovisual closed 8 years ago

radiovisual commented 8 years ago

This is a feature request to add a prompt asking for the project description. If no description is provided, then the default is to use one of the superb phrases like 'my awesome module'

The argument is that providing a prompt for the description saves the user time by saving them from lots of keystrokes/mouse clicks and moving in and out of different files.

For example:

To update the description WITHOUT a prompt:

TOTAL INTERACTION EVENTS: *16

The example above uses the "best case scenario", because if the user doesn't copy-paste the description after typing it once, then they find themselves typing it twice, or cycling back to the file where the description was first typed, just to copy, switch back to another file and paste, adding a lot more extra interaction events.


To update the description WITH a prompt:

TOTAL INTERACTION EVENTS: *1


You can see how prompting for the description saves time!

For those looking for the default behavior (the superb placeholder), they would just have to enter a blank description, costing them one extra keystroke, at the expense of having the ability to save a minimum of 16 keystokes by entering the project description at the prompt.


* does not include the typing of the description

sindresorhus commented 8 years ago

Already discussed in https://github.com/sindresorhus/generator-nm/issues/29, but seems many want this, so sure. Pull request welcome :)

radiovisual commented 8 years ago

Oh, sorry, I didn't see the archived discussions in #29 and #16, but now that I have read them, I see that a common argument is that some won't know the description beforehand (which is usually true for me on large modules, where I keep having to change the wording of the description), and totally understandable, but on many of my smaller modules (which make up the majority for me), I know exactly what the description is going to say as I am scaffolding out the module, and I find myself running into the tedium of all those 16+ extra steps to replace the placeholder description.

So, IMO, adding in one extra keystroke at the prompt to keep the placeholder ("superb") description, is a small price to pay for the added benefit of being able to update the description in one step.

I can work on this PR today. 😄