Search code examples
node.jsreact-nativepackagebuilt-in

How do I include and require a built-in node package in a React-Native app?


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');

Related unanswered question


Solution

  • The mvayngrib/react-native-crypto Node.js package does this.