Skip to content
This repository has been archived by the owner on Aug 11, 2021. It is now read-only.

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Aug 17, 2012
1 parent b875c0c commit f61ec6b
Showing 1 changed file with 23 additions and 9 deletions.
32 changes: 23 additions & 9 deletions README.md
Expand Up @@ -8,7 +8,7 @@ It handles all the caching and HTTP calls.


```javascript ```javascript
var RegClient = require('npm-registry-client') var RegClient = require('npm-registry-client')
var client = new RegClient(options) var client = new RegClient(config)


client.get("npm", "latest", 1000, function (er, data, raw, res) { client.get("npm", "latest", 1000, function (er, data, raw, res) {
// error is an error if there was a problem. // error is an error if there was a problem.
Expand All @@ -18,29 +18,43 @@ client.get("npm", "latest", 1000, function (er, data, raw, res) {
}) })
``` ```


# Options # Configuration

This program is designed to work with
[npmconf](https://npmjs.org/package/npmconf), but you can also pass in
a plain-jane object with the appropriate configs, and it'll shim it
for you. Any configuration thingie that has get/set/del methods will
also be accepted.


* `registry` **Required** {String} URL to the registry * `registry` **Required** {String} URL to the registry
* `cache` **Required** {String} Path to the cache folder * `cache` **Required** {String} Path to the cache folder
* `alwaysAuth` {Boolean} Auth even for GET requests. * `always-auth` {Boolean} Auth even for GET requests.
* `auth` {String} A base64-encoded `username:password` * `auth` {String} A base64-encoded `username:password`
* `email` {String} User's email address * `email` {String} User's email address
* `tag` {String} The default tag to use when publishing new packages. * `tag` {String} The default tag to use when publishing new packages.
Default = `"latest"` Default = `"latest"`
* `ca` {String} Cerficate signing authority certificates to trust. * `ca` {String} Cerficate signing authority certificates to trust.
* `strictSSL` {Boolean} Whether or not to be strict with SSL * `strict-ssl` {Boolean} Whether or not to be strict with SSL
certificates. Default = `true` certificates. Default = `true`
* `userAgent` {String} User agent header to send. Default = * `user-agent` {String} User agent header to send. Default =
`"node/{process.version}"` `"node/{process.version}"`
* `log` {Object} The logger to use. Defaults to `require("npmlog")` if * `log` {Object} The logger to use. Defaults to `require("npmlog")` if
that works, otherwise logs are disabled. that works, otherwise logs are disabled.
* `retries` {Number} Number of times to retry on GET failures. * `fetch-retries` {Number} Number of times to retry on GET failures.
Default=2 Default=2
* `retryFactor` {Number} `factor` setting for `node-retry`. Default=10 * `fetch-retry-factor` {Number} `factor` setting for `node-retry`. Default=10
* `retryMinTimeout` {Number} `minTimeout` setting for `node-retry`. * `fetch-retry-mintimeout` {Number} `minTimeout` setting for `node-retry`.
Default=10000 (10 seconds) Default=10000 (10 seconds)
* `retryMaxTimeout` {Number} `maxTimeout` setting for `node-retry`. * `fetch-retry-maxtimeout` {Number} `maxTimeout` setting for `node-retry`.
Default=60000 (60 seconds) Default=60000 (60 seconds)
* `proxy` {URL} The url to proxy requests through.
* `https-proxy` {URL} The url to proxy https requests through.
Defaults to be the same as `proxy` if unset.
* `_auth` {String} The base64-encoded authorization header.
* `username` `_password` {String} Username/password to use to generate
`_auth` if not supplied.
* `_token` {Object} A token for use with
[couch-login](https://npmjs.org/package/couch-login)


# client.request(method, where, [what], [etag], [nofollow], cb) # client.request(method, where, [what], [etag], [nofollow], cb)


Expand Down

0 comments on commit f61ec6b

Please sign in to comment.