Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
webdav request made easy
Browsers
and Node.js
commonjs
and esm
npm install tsdav
or
yarn add tsdav
import { createDAVClient } from 'tsdav';
(async () => {
const client = await createDAVClient({
serverUrl: 'https://apidata.googleusercontent.com/caldav/v2/',
credentials: {
refreshToken: 'YOUR_REFRESH_TOKEN_WITH_CALDAV_PERMISSION',
},
authMethod: 'Oauth',
defaultAccountType: 'caldav',
});
const calendars = await client.fetchCalendars();
const calendarObjects = await client.fetchCalendarObjects({
calendar: calendars[0],
});
})();
import { createDAVClient } from 'tsdav';
(async () => {
const client = await createDAVClient({
serverUrl: 'https://contacts.icloud.com',
credentials: {
username: 'YOUR_APPLE_ID',
password: 'YOUR_APP_SPECIFIC_PASSWORD',
},
authMethod: 'Basic',
defaultAccountType: 'carddav',
});
const addressBooks = await client.fetchAddressBooks();
const vcards = await client.fetchVCards({
addressBook: addressBooks[0],
});
})();
After v1.1.0
, you have a new way of creating clients.
import { DAVClient } from 'tsdav';
const client = new DAVClient({
serverUrl: 'https://apidata.googleusercontent.com/caldav/v2/',
credentials: {
refreshToken: 'YOUR_REFRESH_TOKEN_WITH_CALDAV_PERMISSION',
},
authMethod: 'Oauth',
defaultAccountType: 'caldav',
});
(async () => {
await googleClient.login();
const calendars = await client.fetchCalendars();
const calendarObjects = await client.fetchCalendarObjects({
calendar: calendars[0],
});
})();
import { DAVClient } from 'tsdav';
const client = new DAVClient({
serverUrl: 'https://contacts.icloud.com',
credentials: {
username: 'YOUR_APPLE_ID',
password: 'YOUR_APP_SPECIFIC_PASSWORD',
},
authMethod: 'Basic',
defaultAccountType: 'carddav',
});
(async () => {
await client.login();
const addressBooks = await client.fetchAddressBooks();
const vcards = await client.fetchVCards({
addressBook: addressBooks[0],
});
})();
Check out the Documentation
refers to Changelog
this package uses debug
package,
add tsdav:*
to DEBUG
env variable to enable debug logs
v1.1.0
breaking changes
DAVClient
is no longer a type returned by createDAVClient
, instead it's a class that can be instantiated.timeRange
in fetchCalendarObjects
is now validated against ISO_8601
standard and invalid format will throw an error.es2015
, if you are on node >= 10
and browsers that are not IE and have been updated since 2015
, you should be fine. support for es5
output is not possible with added esm
support.features
DAVClient
by new DAVClient(...params)
.esm
.strict
enabled, which means better types and less bugs.FAQs
WebDAV, CALDAV, and CARDDAV client for Nodejs and the Browser
The npm package tsdav receives a total of 0 weekly downloads. As such, tsdav popularity was classified as not popular.
We found that tsdav demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.