To keep myself sane while working with The npm Registry I decided to write my
own library to deal with all the incomplete, inconsistent and horrible data
structures that are available in The npm Registry. NoSQL is nice and all, but
that doesn't mean you should leave your data unmaintained. This library is never
meant as a full replacement of the npm-registry-client which the npm bin
file is using. Unless those API's and methods are so poorly implemented or
designed that I get a mental breakdown, then yes, this will become a full and
usable replacement of the above said module.

This module is written with high availability in mind. The main reason behind
this is that npm Inc. has added a lot of moving parts on top of the registry
which frequently breaks. In order to combat this I've implemented automatic
downgrading to multiple registries. If all other supplied registries fail to
work an automatic exponential randomized back off algorithm kicks in place and
retries the query once more. This functionality is all provided by the awesome
mana package which provides core functionality for writing sane api-clients.

Retrieve additional details for the package information. This a lot slower than
a simple .get but much more detailed and accurate as it uses custom parsers
for accurate licensing information. Which could require a fair amount of npm and
github lookups.

Retrieve all release specific information for the given package name. Please
note that this uses the npm.packages.details call under the hood to provide
more detailed information but it will therefor also take longer.

Get a release that is satisfying a given semver range. Please note that this
uses the npm.packages.details call under the hood to provide more detailed
information but it will therefor also take longer.

Same as above, but it doesn't get the total/summary of the downloads but an array
with the downloads per day. The same date ranges are allowed and if no package name
is supplied, all packages is assumed.

As the internal data structure is do damn awkward and unmaintained in npm we
need to normalize the data structures before we can even try to use it. While
this normalization is part automatically done for you internally there might be
use cases where you want to manually normalize a given dataset. The normalize
module can be required directly using:

var normalize =require('npm-registry/normalize');

The normalize variable now contains two different functions, users and
packages. As you might have guessed, these functions normalize different data
structures. The function accepts a simple single argument which is the data
object that you receive from the npm registry endpoints.