-
Notifications
You must be signed in to change notification settings - Fork 64
Open
Description
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 thanrequire('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 isrc['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.
atsoares, Faline10, DMeechan, walfie, richpjames and 3 more
Metadata
Metadata
Assignees
Labels
No labels