No description
Find a file
Antoine Mazeas 44a29b25dd expand readme
Signed-off-by: Antoine Mazeas <antoine@karthanis.net>
2024-12-08 21:41:54 +01:00
src fix bug with ended recurring event expansion 2024-12-08 21:25:28 +01:00
test fix bug with ended recurring event expansion 2024-12-08 21:25:28 +01:00
.gitignore first commit 2024-04-13 00:32:32 +02:00
biome.json add biome + lint+format 2024-12-01 03:01:34 +01:00
bun.lockb add biome + lint+format 2024-12-01 03:01:34 +01:00
package.json fix bug with ended recurring event expansion 2024-12-08 21:25:28 +01:00
README.md expand readme 2024-12-08 21:41:54 +01:00
tsconfig.json advance 2024-04-20 02:45:57 +02:00
upcoming.ts rename project upcoming 2024-12-05 23:35:40 +01:00

upcoming

Get the upcoming events from an iCal source. Recurring events are expanded as necessary.

Installation

Add the library to your list of dependencies:

bun add git+https://code.barbed.fr/karthanistyr/upcoming

Usage

Start by creating the raw calendar

import { getCalendar } from 'upcoming';

let calendar = await getCalendar("<url to the ical data source>");

Then create the class to handle your queries:

import { EventList } from 'upcoming';

let event_list = new EventList(calendar.events);

Query the Event List for events in a given timeframe:

let upcoming_events = event_list.getEventsForNextDays(<number of days>);

Development

This project uses bun as its package manager, test runner and bundler. Install bun from here: https://bun.sh/

Install dependencies:

bun install

Check code formatting and linting:

bun format

Run tests

bun cover

Build a working bundle (note that this is not the standard bun build hence the run):

bun run build

This project was created using bun init in bun v1.1.2. Bun is a fast all-in-one JavaScript runtime.