isaacs/npm — pull request #2348 by timoxley (2012-04-06 19:23:27+00:00)
Title: Added --save-dev and --save-optional to `npm install`

As above. It looks like it works, the test suite confuses me at the moment. Your call if you want tests.