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

Responses are not filtered as promised #153

Open
medikoo opened this issue Mar 27, 2017 · 2 comments
Open

Responses are not filtered as promised #153

medikoo opened this issue Mar 27, 2017 · 2 comments

Comments

@medikoo
Copy link

medikoo commented Mar 27, 2017

At https://github.com/npm/npm-registry-client#requests is indicated that special header is added, so resolved meta-data is light.

It seems to be not the case now (v8.1.0), following:

var RegClient = require('npm-registry-client')
var client = new RegClient()
var uri = "https://registry.npmjs.org/npm"
var params = { timeout: 1000 }

client.get(uri, params, function (error, data, raw, res) {
	if (error) throw error;
	console.log("Versions count", Object.keys(data.versions).length);
	console.log("JSON Size", raw.length);
});

Outputs:

info attempt registry request try #1 at 4:06:18 PM
http request GET https://registry.npmjs.org/npm
http 200 https://registry.npmjs.org/npm
Versions count 256
JSON Size 6252157

This however might be registry issue, as indeed the header does not seem to have expected effect.
I reported it here: https://github.com/npm/registry/issues/147

@zkat
Copy link
Contributor

zkat commented Mar 27, 2017

@medikoo you need fullMetadata: true in your params.

@medikoo
Copy link
Author

medikoo commented Mar 28, 2017

@zkat this doesn't change anything, also I would suspect that fullMetadata: true will force not filtered response. While here issue is that not filtered response is returned by default, and I don't see a way to receive a filtered response.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants