Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: support decoding data URL in Node < v16 (#3)
Node < v16 do not provide a global `atob()` function for decoding base64 strings, and must use `Buffer.from()` instead. Furthermore, `Buffer.from(str, 'base64').toString()` is much faster than `atob()` in Node. Thus, we should use `Buffer.from()` whenever it is available.
- Loading branch information