data-uri-to-buffer@6.0.0
github-actions
released this
30 Sep 14:29
·
25 commits
to main
since this release
Major Changes
-
52b458f: Refactor to return an
ArrayBuffer
instead of a Node.jsBuffer
.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 anArrayBuffer
like so:const uri = 'data:,Hello%2C%20World!'; const parsed = dataUriToBuffer(uri); const buffer = Buffer.from(parsed.buffer); // `buffer` is a Node.js Buffer