Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation does not help the request user #55

Open
john-aws opened this issue Oct 25, 2019 · 1 comment
Open

Documentation does not help the request user #55

john-aws opened this issue Oct 25, 2019 · 1 comment

Comments

@john-aws
Copy link

The request package suggests that:

If you'd like request to return a Promise instead, you can use an alternative interface wrapper for request.

It then proceeds to suggest request-promise-native for native Promises.

The problem is that the request-promise-native package's documentation is minimal, and will probably mislead most request users who are simply looking to promisify their code.

Specific examples include:

  • the documentation says that you need to npm install both request and request-promise-native, but then fails to indicate that your code should require('request-promise-native') rather than require('request'). This might seem minor, but it's likely to be very confusing to newcomers from request.
  • the API appears to be quite different, but there is no documentation to this effect. For example, to retrieve content-type from request.head is rc.headers.get('content-type') but with request-promise-native is rc['content-type']

As it stands, I suspect the casual request user would be better-served by simply using util.promisify. It would be good to write some basic documentation.

@ghost
Copy link

ghost commented Dec 17, 2019

... and no mention of how to turn off insanely verbose logging

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

No branches or pull requests

1 participant