Skip to main content

Install from npm

Import @oxhq/calit-now once in a browser entry point to register <cal-it>. For calendar links or iCalendar files without a DOM, use @oxhq/calit-now/core.

Self-host the scripts

Download the built assets and serve them with a JavaScript MIME type from your own site. You can also build them with npm ci && npm run build from the OSS repository.

Public functions

If you downloaded the standalone file instead, change the import to its local path. In Node, use an ES module project or save the downloaded file as core.mjs.
  • normalizeEvent(event) returns from and until as epoch milliseconds, allDay, and the normalized metadata. Invalid input throws.
  • buildCalendarLinks(event) returns the three provider editor URLs; it does not make any network requests.
  • toICS(event, { now }) returns iCalendar text. The optional now is a Date to control the export timestamp in tests. Supply a stable uid to identify the same event across exports; reimport behavior depends on the calendar app.
GitHub Pages demo URLs follow the current build. For reproducibility, keep your own release copy and keep its filename versioned. You can build and validate examples with npm test; the browser suite is npm run test:browser after installing Chromium as described in the repository.