TooTallNate / proxy-agents

Node.js HTTP Proxy Agents Monorepo
https://proxy-agents.n8.io
872 stars 229 forks source link

[data-uri-to-buffer] Refactor to return an `ArrayBuffer` instead of a Node.js `Buffer` #252

Closed TooTallNate closed 9 months ago

TooTallNate commented 9 months ago

Refactor to return an ArrayBuffer instead of a Node.js Buffer.

This change is being made to make the package platform-agnostic, and work in web browsers or other non-Node.js environments without polyfills.

For Node.js users of this package, you can get a Node.js Buffer instance from an ArrayBuffer like so:

const uri = 'data:,Hello%2C%20World!';
const parsed = dataUriToBuffer(uri);
const buffer = Buffer.from(parsed.buffer);
// `buffer` is a Node.js Buffer
changeset-bot[bot] commented 9 months ago

🦋 Changeset detected

Latest commit: 585400622a12d290fb6dfb6fef85cc3a7c367bfd

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages | Name | Type | | ------------------ | ----- | | data-uri-to-buffer | Major | | get-uri | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

vercel[bot] commented 9 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
proxy-agents ✅ Ready (Inspect) Visit Preview Sep 30, 2023 2:22pm