Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/cwlsn/ics-to-json

📅 Convert ICS calendars (eg. Google Calendar) to an opinionated JSON format.
https://github.com/cwlsn/ics-to-json

converter google-calendar ical ics json

Last synced: 5 days ago
JSON representation

📅 Convert ICS calendars (eg. Google Calendar) to an opinionated JSON format.

Awesome Lists containing this project

README

        


ics-to-json


---

Convert the ICS calendar format to JSON data to consume in web apps.

## Usage

```js
import { icsToJson } from 'ics-to-json';

// Get ICS text however you like, example below
// Make sure you have the right CORS settings if needed
const convert = async (fileLocation) => {
const icsRes = await fetch(fileLocation);
const icsData = await icsRes.text();
// Convert
const data = icsToJson(icsData);
return data;
};
```

## Format

Result is an array of:

```js
{
startDate: '20180505T020000Z',
endDate: '20180505T060000Z',
description: 'Big Event!',
location: 'The place!',
summary: 'Summary!'
}
```

## Upcoming

- Ability to reverse conversion
- Include the rest of the keys from the ICS format