Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
matrix:
node:
- lts/*
- '22.x'
- node
steps:
- name: "Checkout"
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,11 @@ jobs:
gh release upload ${{ github.event.release.tag_name }} \
dist/ical.js \
dist/ical.min.js \
dist/ical.es5.cjs \
dist/ical.es5.min.cjs
dist/ical.cjs \
dist/ical.min.cjs \
dist/ical.browser.js \
dist/ical.browser.min.js \
dist/ical*.map

- name: "npm publish"
run: npm publish
14 changes: 9 additions & 5 deletions jsdoc.json → .jsdocrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,19 @@
"include": "lib/ical",
"includePattern": ".js$"
},
"plugins": ["plugins/markdown", "tools/jsdoc-ical.cjs", "node_modules/jsdoc-tsimport-plugin/index.js"],
"plugins": [
"plugins/markdown",
"tools/jsdoc-ical.cjs",
"node_modules/jsdoc-tsimport-plugin/index.js"
],
"opts": {
"encoding": "utf8",
"readme": "README.md",
"destination": "docs/api/",
"template": "node_modules/clean-jsdoc-theme",
"theme_opts": {
"default_theme": "light"
}
"template": "node_modules/clean-jsdoc-theme"
},
"theme_opts": {
"default_theme": "light"
},
"markdown": {
"hardwrap": false,
Expand Down
6 changes: 6 additions & 0 deletions .mocharc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"ui": "tdd",
"require": "test/support/helper.js",
"reporter": "spec",
"timeout": 5000
}
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ Then simply import it for use:
import ICAL from "ical.js";
```

CommonJS consumers can use `const ICAL = require("ical.js");`.

If you are working with a browser, be aware this is an ES6 module:

```html
Expand All @@ -49,18 +51,18 @@ If you are working with a browser, be aware this is an ES6 module:
</script>
```

If you need to make use of a script tag, you can use the transpiled ES5 version:
If you need to use a classic script tag, load the modern browser-global bundle. It requires a modern browser and does not support ES5-era engines:
```html
<script src="https://unpkg.com/ical.js/dist/ical.es5.min.cjs"></script>
<script src="https://unpkg.com/ical.js/dist/ical.browser.min.js"></script>
<textarea id="txt"></textarea>
<button onclick="ICAL.parse(document.getElementById('txt').value)"></button>
```

The browser examples above use the minified versions of the library, which is probably what you want.
However, there are also unminified versions of ICAL.js available on unpkg.
However, there are also unminified versions of ICAL.js available on unpkg. Source maps are published with the bundles.

- Unminified ES6 module: `https://unpkg.com/ical.js/dist/ical.js`
- Unminified ES5 version: `https://unpkg.com/ical.js/dist/ical.es5.cjs`
- Unminified ES module: `https://unpkg.com/ical.js/dist/ical.js`
- Unminified browser-global bundle: `https://unpkg.com/ical.js/dist/ical.browser.js`

## Timezones
The stock ical.js does not register any timezones, due to the additional size it brings. If you'd
Expand Down
10 changes: 0 additions & 10 deletions jsdoc-prepare.json

This file was deleted.

Loading
Loading