hoa-events

1.0.8 • Public • Published

HOA-events

Package to get events easily from http://open-api.myhelsinki.fi

Installation

$ npm install hoa-events
const hoa = require('hoa-events');

Methods

NOTE: All function are asynchronous.

getAllEvents();

getTodaysEvents();

getOngoingEvents();

getEventsStarts();

getTags();

getEventsWithTags();

Usage

getAllEvents()

With getAllEvents() you can get all events on MyHelsinki open API.

var events = await hoa.getAllEvents();

getTodaysEvents()

With getTodaysEvents() you can get all events starting today.

var events = await hoa.getTodaysEvents();

getOngoingEvents()

With getOngoingEvents() you can get all events that are currently ongoing.

var events = await hoa.getOngoingEvents();

getEventsStarts(date)

With getEventsStarts() you can get all events that starts on a given day. This functhion takes a Date object as parameter.

var date = new Date(Date.parse('2020-11-30'));
var events = await hoa.getEventsStarts(date);

getTags()

With getTags() you can get all tags the events can have.

var tags = await hoa.getTags();

getEventsWithTags(array)

With getEventsWithTags(array) you can get all events that include at least one of the given tags. In the parameter of the function give an array of one or more tags you want the events to have.

var events = await hoa.getEventsWithTags(['health','trips']);

Package Sidebar

Install

npm i hoa-events

Weekly Downloads

0

Version

1.0.8

License

ISC

Unpacked Size

4.88 kB

Total Files

3

Last publish

Collaborators

  • jussisalmela