Skip to content

jsparber/node-caldav-mod

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-caldav-mod

A lightweight Node.JS Caldav Client

Usage

  npm install {github repo}
var caldav = require("node-caldav-mod");

Event

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 Events

/**
 * 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)

Add Event

/**
 * 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)

Delete Event

/**
 * 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)

Fork

I have forked this project because the error handling was really bad and I needed a method for deleting events.

About

A lightweight Node.JS Caldav Client

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%