# ical

> A tolerant, minimal icalendar parser

Latest version **0.8.0** (published 2020-04-07) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install ical
pnpm add ical
yarn add ical
bun add ical
```

## Health

**Score 23/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.8.0 |
| Published | 2020-04-07 |
| First published | 2011-03-10 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | separate (@types/ical) |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 139.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 315 |
| Author | Peter Braden |
| Maintainers | peterbraden |
| Keywords | ical, ics, calendar |

## Links

- npm: https://www.npmjs.com/package/ical
- Repository: https://github.com/peterbraden/ical.js
- Issues: https://github.com/peterbraden/ical.js/issues
- npm.io page: https://npm.io/package/ical

## Dependencies (1)

- [rrule](https://npm.io/package/rrule.md) 2.4.1

## Recent versions

- 0.8.0 (latest) — 2020-04-07
- 0.3.0 (0.3.0) — 2014-09-03
- 0.7.0 — 2020-04-07
- 0.6.0 — 2019-03-25
- 0.5.0 — 2016-04-14
- 0.4.0 — 2015-04-16
- 0.3.1 — 2014-09-03
- 0.2.0 — 2013-07-17
- 0.1.0 — 2013-04-23
- 0.0.6 — 2012-03-08
- 0.0.5 — 2012-01-02
- 0.0.4 — 2011-04-13
- 0.0.3 — 2011-03-16
- 0.0.2 — 2011-03-10
- 0.0.0 — 2011-03-10

## README

# ical.js #
(Formerly node-ical)

[![Build Status](https://travis-ci.org/peterbraden/ical.js.png)](https://travis-ci.org/peterbraden/ical.js)

A tolerant, minimal icalendar parser for javascript/node
(http://tools.ietf.org/html/rfc5545)

## Install - Node.js ##

ical.js is availble on npm:

    npm install ical

## API ##

    ical.parseICS(str)

Parses a string with an ICS File

    var data = ical.parseFile(filename)

## Example 1 - Print list of upcoming node conferences (see example.js)
```javascript
'use strict';

const ical = require('ical');
const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];

const data = ical.parseICS('content from ical file');

for (let k in data) {
	if (data.hasOwnProperty(k)) {
		var ev = data[k];
		if (data[k].type == 'VEVENT') {
			console.log(`${ev.summary} is in ${ev.location} on the ${ev.start.getDate()} of ${months[ev.start.getMonth()]} at ${ev.start.toLocaleTimeString('en-GB')}`);

		}
	}
}
```

## Recurrences and Exceptions ##
Calendar events with recurrence rules can be significantly more complicated to handle correctly.  There are three parts to handling them:

 1. rrule - the recurrence rule specifying the pattern of recurring dates and times for the event.
 2. recurrences - an optional array of event data that can override specific occurrences of the event.
 3. exdate - an optional array of dates that should be excluded from the recurrence pattern.

See example_rrule.js for an example of handling recurring calendar events.

---
_Source: https://npm.io/package/ical · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
