dominictarr / npmd

MIT License
450 stars 37 forks source link

force update sync info about a package or packages #20

Open timoxley opened 10 years ago

timoxley commented 10 years ago

It'd be nice if there was a way to tell npmd to make sure it's loaded the latest information about some specific packages.

Currently, there have no way to ensure that npmd is working with the latest data, or that it even has any data at all. Rather, you have to run npmd --sync, wait some unspecified amount of time, and hope the sync has perhaps gotten around to updating the particular package(s) you're interested in.

Use case is running npmd at an airport and praying it gets through all the packages you're interested in for hacking on your flight.

Perhaps the most sensible api would be to specify modules with --sync:

> npmd --sync through dnode etc

This would exit with success when the specified packages were brought up to date.

Perhaps would be nice if you could easily generate the list of packages to sync by traversing an existing package.json + node_modules hierarchy but that's probably another issue.

dominictarr commented 10 years ago

Oh, what about a progress bar?

Could jump ahead, though you'd have to traverse the deps too, actually that wouldn't be too complex to put in. If you made a thing that just did http requests to retrive all deps, starting at a specific module, then I could just feed that into level-couchsync. should be fairly easy.

The other thing that is necessary, is to fix resolve to use versions that you have in your cache. currently, if there are new versions that you don't have yet, it won't install. This part will be harder.

Also, freshen the tarball cache for the modules you use.

timoxley commented 10 years ago

Oh, what about a progress bar?

Yep, this would definitely improve the niceness of using npmd.

If you made a thing that just did http requests to retrive all deps, starting at a specific module, then I could just feed that into level-couchsync. should be fairly easy.

I don't quite get what you're suggesting with regard to couch-sync. I'm imagining this functionality would step around the follow behaviour in level-couchsync, and simply do some GETs to the master npm couch, then insert that data directly into the npmd database?

dominictarr commented 10 years ago

yes, basically, but you'd still feed it through the transforms that npmd uses. the docs arn't the same format as in the registry exactly, to benefit from the strengths of leveldb.