node-ical icon indicating copy to clipboard operation
node-ical copied to clipboard

optional react-native-fs require

Open triple7 opened this issue 2 years ago • 0 comments

Hi, and thanks for writing this. I'm finishing up a uni project to parse student timetables for matching and found node-ical which does the job normally, but the project currently is in react-native. I tried replacing const ical = require{'fs'}; with require{'react-native-fs'}; after yarn add react-native-fs but I get the following error: Unable to resolve module path from /Users/osiris/Dropbox/Uni/s22021/deco3800/UQ-Pool/clientside/node_modules/node-ical/ical.js: path could not be found within the project or in these directories: node_modules/node-ical/node_modules node_modules ../node_modules

The file ical.js is there but it's not finding it when I run expo start to try on a simulator.

I'm a bit new with js node module creation and wondered if there is a dependency that breaks somewhere for some reason or is there a way to do an if else on the require import, depending on the system/end user platform being used?

thanks :)

triple7 avatar Oct 21 '21 18:10 triple7