isaacs/npm — pull request #3853 by scherler (2013-09-03 00:12:48+00:00)
Title: Rewrite of login/adduser to allow private registries and protected user dbs

fixes https://github.com/isaacs/npmjs.org/issues/117
* Enabling private repos by passing the couch object to addUser to not do the work twice
* using couch login instead of a put
* enabling to create new user if you have been admin before
* adding note if a 404 occurs - an indicator for a private rep
* enabling defaultRoles to be configured instead on an empty array
* this allows to create new user with default roles defined
* in .npmrc `defaultRoles = devs,clients`
* in cli `npm adduser -defaultRoles=devs,clients`
* if not defined in the config we use the current value
* pointing out that you as well can login as an admin user