Reputation: 2254
Node comes with some built-in packages, such as crypto
. These are installed when Node is installed. They are not downloaded into the node_packages
folder by npm
.
How do I make one of these built-in packages available in my app so I can require it as follows:
const crypto = require('crypto');
Upvotes: 1
Views: 941
Reputation: 496
The short answer is you can't.
crypto
isn't pollyfilled by react-native, see issue 5049 for more info.
An alternative is to use a 3rd party module that attempts to mimic the crypto module in react-native but the few I checked were only partially implemented.
Upvotes: 2