
Product
Unify Your Security Stack with Socket Basics
A single platform for static analysis, secrets detection, container scanning, and CVE checks—built on trusted open source tools, ready to run out of the box.
cbor-rn-prereqs
Advanced tools
Make it easier to use the cbor package in React Native.
NOTE
All users of this library should move to the cbor2 library. It is where most maintenance and support and all new features are happening. This set of workarounds has always been lightly-maintained, since React Native's JS implementation is... not that similar to other modern runtimes.
Only catastrophic bugs will be fixed in this library going forward.
$ npm install --save cbor cbor-rn-prereqs
Ensure you have a file named metro.config.js
in your project root, and that
it contains at least this:
module.exports = {
resolver: {
extraNodeModules: {
stream: require.resolve('stream-browserify'),
},
},
};
require
this package before importing or requiring cbor
:
require('cbor-rn-prereqs');
const cbor = require('cbor');
This package bundles up a few additions to the JavaScript-like environment that React Native provides. In particular:
process
in your environment, all of the process
package gets installed globally. If there is, but it doesn't have nextTick
, just nextTick
will be added to the existing global process
instance.stream-browserify
needs to be made available when packages do require('stream')
, which is enabled by the metro.config.js
change above.
FAQs
React Native pre-requisites for cbor
The npm package cbor-rn-prereqs receives a total of 262 weekly downloads. As such, cbor-rn-prereqs popularity was classified as not popular.
We found that cbor-rn-prereqs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
A single platform for static analysis, secrets detection, container scanning, and CVE checks—built on trusted open source tools, ready to run out of the box.
Product
Socket is launching experimental protection for the Hugging Face ecosystem, scanning for malware and malicious payload injections inside model files to prevent silent AI supply chain attacks.
Research
/Security News
The Socket Threat Research Team uncovered a coordinated campaign that floods the Chrome Web Store with 131 rebranded clones of a WhatsApp Web automation extension to spam Brazilian users.