jprichardson / npm-latest

Quickly find the latest version of a package in npm.
MIT License
12 stars 4 forks source link

why not use built in npm commands? #1

Closed timoxley closed 12 years ago

timoxley commented 12 years ago

npm install --save express@latest will get the latest version of express and automatically updates your package.json dependencies with that version.

jprichardson commented 12 years ago

Nice. Thanks for sharing. I just tried it out, but it butchered the formatting of my package.json file, which it's too early to tell if I want to deal with that or not. However, I'm going to make a note of this in the readme. Thanks again.

timoxley commented 12 years ago

I only edit my package.json manually if I'm adding things like scripts, most common things I want to do is automated these days. Originally I didn't like the way it formatted my file either but I concede that conforming to convention, and using npm automation is more beneficial than a mostly arbitrary json formatting preference.

Other handy commands that write to your package.json:

npm init writes your initial package.json with author, github, test commands, etc. npm install --save-dev module …saves module as a dev-dependency npm install --save-optional module …saves module as a optional dependency npm remove --save module removes module and takes it out of your dependencies