Exist an open-source API that make webcraping in my university student page logging, getting infos and downloading files. API is written using standard node library, using http, https, path and some other libraries for web scraping. I want to create an app that uses this API, but when importing it into an expo project, an error like: "It failed because the native React runtine does not include the Node standard library".
How to use the node API in expo project just with mocks, library replacements with equivalent react-native compatible libraries or something like that? Trying to avoid having to rewrite a considerable part of the API.
To resolve this i tried to:
Imported
'node-libs-react-native'
inextraNodeModules
intometro.config.js
file in expo project to replace default node library with mock or equivalent node modules ported to browser, but failed because when opened in the emulator I got a type error in the library path because they expected a string value instead of the object value. Probably because the equivalent path library doesn't have the same methods, parameters or something.Modified the
babel.config.js
of the API to alias the incompatible libraries for mocks or browser libraries, but it doesn't work having in the end the same error practically of import'node-libs-react-native'
in the expo project.