What is the best way to parse an ical / ics file? I have it all in a string, but I cant find a package or library that is compatible with RN. All the general JS or Node ones throw errors about the FS package missing. I am reading it in from a URL and have it all in memory so I don't even need file system access.
Anyone looking for the answer to this question in 2019+, I've written an npm module to solve this problem! You can find it here! (https://github.com/Christop406/ical-parser).
Or, if you're lazy, just run npm i cal-parser
(NOT ical-parser
).
You can use it like this:
const ical = require('cal-parser');
var parsedCal = ical.parseString(MY_ICAL_STRING);
console.log(parsedCal.calendarData); // for calendar metadata
console.log(parsedCal.events); // for calendar events
Happy parsing!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With