conditionally polyfill Buffer, Crypto, and Constants. A Node.js project should thus be unaffected by these changes, but browser users can now use node-rsa out of the box without having to do polyfilling themselves.
This includes changes from @learntheropes 's fork for running node-rsa in the browser out of the box. The main thing their fork does is use the buffer package instead of assuming Buffer was available. Their fork did not make this a conditional change, which means someone using @learntheropes/node-rsa in node will end up using the npm package rather than the node one. My changes address this.
This PR does two things:
npm audit fix --force
node-rsa
out of the box without having to do polyfilling themselves.This includes changes from @learntheropes 's fork for running node-rsa in the browser out of the box. The main thing their fork does is use the buffer package instead of assuming
Buffer
was available. Their fork did not make this a conditional change, which means someone using@learntheropes/node-rsa
in node will end up using the npm package rather than the node one. My changes address this.