github sindresorhus/got v11.0.0-beta.1

$ npm install got@11.0.0-beta.1

The release notes will be improved in the final v11 release.

Changes in beta 1:

Breaking

API
  • options.encoding will no longer affect streams (reverting back to the Got 9 behavior), use got.stream(…).setEncoding(encoding) instead (to prevent confusion).
  • Renamed GotError to RequestError.
  • options.agent can no longer be an instance of http.Agent. Instead you need to pass:
    js { http: new http.Agent(…), https: new https.Agent(…), http2: new http2wrapper.Agent(…) }
    - The deprecated useElectronNet option has been removed.
    - dnsCache is now enabled by default.
    - dnsCache no longer can be a Map or a Keyv instance, instead you need to pass a CacheableLookup instance.
    - Errors thrown in init hooks will be converted to RequestErrors (why: RequestError provides much more useful information (e.g. Got options) than the usual TypeError etc.).
    - options._pagination has been renamed to options.pagination.
    - The options.url property will no longer be visible in init hooks (design limitation).
    - The error.request property is no longer a ClientRequest instance. Instead, it gives a Got stream.
    ##### Types
    - The ResponseObject type has been merged into the Response type.
    - Renamed the Defaults type to InstanceDefaults.
    - Renamed the DefaultOptions type to Defaults.
    - Renamed the DefaultRetryOptions type to RequiredRetryOptions.
    - Renamed the GotOptions type to Options.
    - Renamed the GotRequestMethod type to GotRequestFunction.
    ### Enhancements
    1. Fixes #1016
    2. Fixes #981
    3. Fixes #932
    4. Fixes #929
    5. Fixes #1058
    6. Fixes #167
    7. Fixes #1138
    8. Fixes #1113
    9. Fixes #1129
    10. Errors now have a request property (it's a Got stream).
    ### Known bugs
    1. The timings indicate that the request was successful (even though it errored).
    2. The downloadProgress object may show incorrect data if the request has errored.
    ### Bug fixes
    1. Fixes #1036
    2. Fixes #994
    3. Fixes #1026
    4. Fixes #1021
    5. Fixes #1057
    6. Fixes #1050
    7. Fixes #954
    8. Fixes #1011
    9. Fixes #1090
    10. Fixes #1140
    11. Fixes #1118
    https://github.com/sindresorhus/got/compare/v10.7.0...v11.0.0-beta.1
latest releases: v11.7.0, v11.6.2, v11.6.1...
pre-release15 months ago