[get-css] Remove dependency on request #306
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We started using get-css to extract css from a user input website.
Upon deploying we figured out that request is required in our source to make it work because of a missing dependency in requestretry. Upon further investigation it turned out that this library was depending on requestretry, but not actually using the features from it, so I figured to remove that.
However, request itself is deprecated and should perhaps be replaced, for that purpose this also switched to node-fetch instead.
Small note: this (might) change the minimum version required by get-css. Request supports Node >=6, Node-fetch support ^10.17 || >=12.3, this support can be brought down by adding a globalThis polyfill as described here.
I hope this PR is appreciated even though it might not be asked for. ;)