npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

caldavjs-nextcloud

v1.6.2

Published

A lightweight nextcloud (and others) caldav javascript library.

Downloads

8

Readme

CalDavJS-Nextcloud

Client library for CalDAV

Installation and Usage

npm install --save caldavjs-nextcloud
settings: {
    username: "",
    password: "",
    access_token: "An access token to use in place of username/password (not used unless setup in Nextcloud)",
    server: "https://cloud.example.com:3333 or https://cloud.example.com:3333/nextcloud", //NO trailing "/"
    basePath: "The absolute path for caldav calls, e.g. /remote.php/dav for Nextcloud", //YES lead "/"; NO trailing "/"
    principalPath: "The relative path where principals can be found, e.g. /principals/users",  //YES lead "/"; NO trailing "/",
    timezone: "America/Chicago" //sets the default, can be overridden in methods
    parserLogging: true //toggles verbose logging from the calendar parser
  }

caldav.listCalendars({}).then(data => {
  console.log(data);
});

Description

Access and update calendar data using the CalDAV protocol

Actions

listEvents

caldav.listEvents({
  "filename": "/calendars/admin/calendar-name-at-end-of-private-link",
  "start": "20200601T000000Z",
  "end": "20200630T115959Z",
})

Input

  • input object
    • filename required string
    • start date-time
    • end date-time

Output

  • output array
    • items object
      • allDay boolean
      • etag string
      • calendarData string
      • start string
      • end string
      • summary string
      • location string
      • description string
      • color string
      • categories string comma separated
      • json json all event data which was not parsed

createCalendar

caldav.createCalendar({
  "name": "",
  "timezone": "", // only to override settings
  "filename": ""
})

Input

  • input object
    • name required string
    • timezone required string
    • filename required string
    • description string

Output

  • output string

listCalendars

caldav.listCalendars({})

Input

  • input object

Output

  • output array
    • items object
      • owner string
      • displayName string
      • ctag string
      • syncToken string

deleteCalendar

caldav.deleteCalendar({
  "filename": "/calendars/admin/calendar-name-at-end-of-private-link" 
})

Input

  • input object
    • filename required string

Output

  • output string

getChanges

caldav.getChanges({
  "filename": "/calendars/admin/calendar-name-at-end-of-private-link" 
  "syncToken": "http://sabre.io/ns/sync/90" 
})

Input

  • input object
    • filename required string
    • syncToken required string //obtained from list calendars

Output

  • output object
    • syncToken string
    • changes array
      • items object
        • href string
        • etag string

createEvent

caldav.createEvent({
  "allDay": false,
  "start": "ISODateString",
  "end": "ISODateString",
  "summary": "title",
  "filename": "/calendars/admin/calendar-name-at-end-of-private-link/unique-filename-for-this-event",
  "location": "wherever",
  "description": "tell them about it",
  "timezone": "America/Chicago", //only to override settings
  "color": "green",
  "categories": [
    { "name" : "awesome" },
    { "name" : "tags" },
    { "name" : "go" },
    { "name" : "here" }
  ],
  "attendees": [
    {
      "name": "name",
      "email": "[email protected]",
      "mailto": "[email protected]", //to override email
      "type": "one of: individual, group, room, resource, unknown"
    }
  ],
  "organizer": 
    {
      "name": "name",
      "email": "[email protected]",
      "mailto": "[email protected]", //to override email
    }
})

Input

  • input object
    • start required string
    • end required string
    • summary required string
    • organizer string
    • filename required string
    • location string
    • description string
    • timezone string
    • color string
    • categories array of objects
      • name string
    • attendees array of objects
      • name string
      • email string
      • mailto string
      • type string one of "individual", "group", "room", "resource", "unknown"
    • organizer object
      • name string
      • email string
      • mailto string

Output

  • output string

deleteEvent

caldav.deleteEvent({
  "filename": ""
})

Input

  • input object
    • filename required string

Output

  • output string