Importing node's Buffer class before use makes bundling apps simpler because when your target is an environment that doesn't have a Buffer global, you don't have to ensure you've mutated the global object to add Buffer support before @peculiar/webcrypto is loaded - you can just do it by configuring the module resolver with a polyfill instead and let the user load modules in whatever order they want.
This makes bundling react-native apps a bit simpler.
Importing node's
Buffer
class before use makes bundling apps simpler because when your target is an environment that doesn't have aBuffer
global, you don't have to ensure you've mutated theglobal
object to addBuffer
support before@peculiar/webcrypto
is loaded - you can just do it by configuring the module resolver with a polyfill instead and let the user load modules in whatever order they want.This makes bundling react-native apps a bit simpler.