A lightweight Node.JS Caldav Client
npm install {github repo}
var caldav = require("node-caldav-mod");
The event object needs to look like this:
const event = {
key: "", // ID of the event, needs to be unique and can be used to edit the event in the future
summary: "", // The title of the event
startDate: "", // Any timeformat handled by moment.js
endDate: "", // Any timeformat handled by moment.js
}
/**
* Get the events from a CalDAV calendar for a specific range of dates
* @param {string} url - CalDAV Calendar URL
* @param {string} username - CalDAV Username
* @param {string} password - CalDAV password
* @param {string} startDate - Date from which to start, Any timeformat handled by moment.js
* @param {string} endDate - Date from which to stop, Any timeformat handled by moment.js
* @param {function} callback - Callback function
* @function
*/
caldav.getEvents(url, username, password, startDate, endDate, callback)
/**
* Get the events from a CalDAV calendar for a specific range of dates
* @param {string} url - CalDAV Calendar URL
* @param {string} username - CalDAV Username
* @param {string} password - CalDAV password
* @param {function} callback - Callback function
* @function
*/
caldav.addEvent(event, url, username, password, callback)
/**
* Get the events from a CalDAV calendar for a specific range of dates
* @param {string} url - CalDAV Calendar URL
* @param {string} username - CalDAV Username
* @param {string} password - CalDAV password
* @param {function} callback - Callback function
* @function
*/
caldav.removeEvent(event, url, username, password, callback)
I have forked this project because the error handling was really bad and I needed a method for deleting events.