Skip to content

Repository files navigation

cdav-library

REUSE status NPM Version

πŸ“… πŸ“‡ CalDAV and CardDAV client library for JavaScript

Build the library

# install dependencies
npm install

# build for dev and watch changes
npm run watch

# build for dev
npm run dev

# build for production with minification
npm run build

TypeScript definitions

npm run build generates dist/index.d.ts for ES modules and dist/index.d.cts for CommonJS. Development and watch builds also generate these files. They are included in the npm package and resolved automatically:

import DavClient from '@nextcloud/cdav-library'

const client = new DavClient({ rootUrl: 'https://example.com/remote.php/dav/' })
await client.connect({ enableCalDAV: true, enableCardDAV: true })

Definitions are generated from the JavaScript and JSDoc using the existing Vite build. Update the JSDoc when changing the API; do not edit generated files in dist. Dynamically exposed model properties need a JSDoc-annotated this.property reference before they are installed in the constructor. Some legacy APIs still use broad types where their JSDoc does not provide more detail.

Run npm run test:types to build and check strict TypeScript consumers with NodeNext (ES modules and CommonJS) and bundler module resolution. To check an existing build, use npm run check:types.

Running tests

You can use the provided npm command to run all tests by using:

npm run test

✌️ Code of conduct

The Nextcloud community has core values that are shared between all members during conferences, hackweeks and on all interactions in online platforms including Github and Forums. If you contribute, participate or interact with this community, please respect our shared values. 😌

❀️ How to create a pull request

This guide will help you get started:

About

πŸ“… πŸ“‡ CalDAV and CardDAV client library for JavaScript

Topics

Resources

Contributing

Security policy

Stars

73 stars

Watchers

5 watching

Forks

Releases

Used by

Contributors

Languages