node-fetch-har

Generate HAR entries for requests made with node-fetch

MIT License

Downloads
11.8K
Stars
31
Committers
1
node-fetch-har - Latest Release

Published by exogen about 5 years ago

Bug Fix

  • Socket event listeners (lookup, connect, secureConnect) are now attached with once and explicitly removed on request finish. This fixes listeners from sticking around on sockets that end up being reused (for example, with agentkeepalive’s socket pooling.
node-fetch-har -

Published by exogen over 5 years ago

  • No changes from the latest Release Candidate. This library has been deemed stable after several weeks of testing in staging and production environments.
node-fetch-har -

Published by exogen over 5 years ago

Enhancement

  • Set the _resourceType field to fetch so that requests are categorized under XHR/Fetch in common HAR viewers (like Chrome or Firefox’s Network tab).

Internal

  • Use URL.createObjectURL to generate the HAR download link in the Next.js demo. This is preferable because it allows the data to be of any size.
node-fetch-har -

Published by exogen over 5 years ago

New Feature

  • Custom agents! If you pass a custom agent to fetch (as supported by node-fetch) it will be instrumented with HAR tracking behavior. This allows you to use helpers like agentkeepalive.

    If you are using the custom agent outside of withHar contexts as well, this instrumentation should have no adverse effects and will be disabled unless invoked by withHar specifically (since it adds a special header).

Enhancements

  • If not using a custom agent (see above), the HAR tracking agent instances created by withHar are now shared globally, instead of created for each withHar instance.
node-fetch-har -

Published by exogen over 5 years ago

Enhancement

  • Gracefully handle bogus Set-Cookie response headers instead of throwing an error. The header will still appear in headers, but no cookies will be added from it.
node-fetch-har -

Published by exogen over 5 years ago

New Feature

  • Support for the ssl timing when the socket emits a secureConnect event.
node-fetch-har -

Published by exogen over 5 years ago

New Feature

  • The blocked, dns, and connect timings are now recorded.
node-fetch-har -

Published by exogen over 5 years ago

New Feature

  • Support for compression savings info via the compression field.

Enhancement

  • Sizes are now calculated with Buffer.byteLength instead of string length where possible.
  • Use high resolution timestamps via process.hrtime.
  • More accurately determine the send duration by listening for the ClientRequest’s finish event. In practice, most of this time is actually going to be attributable to DNS/connect/SSL/etc. but it’s better than nothing for now.
node-fetch-har -

Published by exogen over 5 years ago

New Feature

  • Support for redirects. When Fetch is configured to transparently follow redirects (the default), multiple HAR entries will be emitted. See the Redirects section of the README.
  • Support for request body info. See the Request Body section of the README.
node-fetch-har -

Published by exogen over 5 years ago

Bug Fix

  • Fix an issue on some versions of node-fetch where the constructor of the returned response is not Response, but rather a different Body class that does not set the same properties. This caused our cloned response instance to not have a headers property. Now, we check the input Fetch instance for a Response property (like node-fetch does) or try to get it from global (like isomorphic-fetch does) before falling back to response.constructor. To fully override the class (for more complicated scenarios), use the new Response option to withHar.

Internal

  • Add real tests using Jest. All of node-fetch, isomorphic-fetch, and isomorphic-unfetch are tested. Even though they all use node-fetch, isomorphic-fetch uses an old version, and we may need to test additional integration points (like what properties exist on the default export).
node-fetch-har -

Published by exogen over 5 years ago

New Feature

  • The cookies field is now populated for requests and responses.
node-fetch-har -

Published by exogen over 5 years ago

New Feature

  • Add pages and custom grouping. This is not especially useful on the server, since there is likely only a single relevant page for each HAR log. But some tools like HAR Viewer do not behave correctly without this field.
  • The Fetch instance returned by withHar, or individual fetch calls, can specify a custom page reference using the harPageRef option.

Enhancement

  • Specify -1 for timings that are not collected, instead of excluding them altogether. Even though the fields are optional, some tools like HAR Viewer do not behave correctly without them.
node-fetch-har -

Published by exogen over 5 years ago

New Feature

  • Allow the har option to withHar or fetch to be a HAR log returned by createHarLog. Entries will automatically be added to it.
node-fetch-har -

Published by exogen over 5 years ago

Internal

  • Add homepage and repository fields so they show up as links on npm.
node-fetch-har -

Published by exogen over 5 years ago

Initial release!

Package Rankings
Top 5.24% on Npmjs.org
Badges
Extracted from project README
npm Travis Coveralls