npm-registry-client
Advanced tools
Comparing version 7.5.0 to 8.0.1
@@ -114,2 +114,5 @@ module.exports = regRequest | ||
// metadata should be minified, if the registry supports it | ||
headers['accept'] = 'application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*' | ||
var er = this.authify(params.authed, parsed, headers, params.auth) | ||
@@ -116,0 +119,0 @@ if (er) return cb_(er) |
@@ -5,3 +5,3 @@ { | ||
"description": "Client for the npm registry", | ||
"version": "7.5.0", | ||
"version": "8.0.1", | ||
"repository": { | ||
@@ -8,0 +8,0 @@ "url": "https://github.com/npm/npm-registry-client.git" |
@@ -56,2 +56,15 @@ # npm-registry-client | ||
## Requests | ||
As of `npm-registry-client@8`, all requests are made with an `Accept` header | ||
of `application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*`. | ||
This enables filtered document responses to requests for package metadata. | ||
You know that you got a filtered response if the mime type is set to | ||
`application/vnd.npm.install-v1+json` and not `application/json`. | ||
This filtering substantially reduces the over all data size. For example | ||
for `https://registry.npmjs.org/npm`, the compressed metadata goes from | ||
410kB to 21kB. | ||
## API | ||
@@ -58,0 +71,0 @@ |
66538
1492
356