ical-generator is a small piece of code which generates ical calendar files
Installations
npm install ical-generator
Developer Guide
Typescript
Yes
Module System
ESM
Min. Node Version
18 || 20 || >=22.0.0
Node Version
22.9.0
NPM Version
10.5.0
Score
84.6
Supply Chain
83.8
Quality
92.5
Maintenance
100
Vulnerability
99.6
License
Releases
v8.0.2-develop.6
Published on 28 Nov 2024
v8.0.2-develop.5
Published on 19 Nov 2024
v8.0.2-develop.4
Published on 12 Nov 2024
v8.0.2-develop.3
Published on 05 Nov 2024
v8.0.2-develop.2
Published on 29 Oct 2024
v8.0.2-develop.1
Published on 22 Oct 2024
Contributors
Languages
TypeScript (98.91%)
JavaScript (0.9%)
CSS (0.2%)
Developer
sebbo2002
Download Statistics
Total Downloads
20,450,068
Last Day
5,098
Last Week
80,414
Last Month
516,987
Last Year
6,464,845
GitHub Statistics
759 Stars
1,775 Commits
160 Forks
11 Watching
4 Branches
68 Contributors
Bundle Size
32.52 kB
Minified
8.48 kB
Minified + Gzipped
Package Meta Information
Latest Version
8.0.1
Package Id
ical-generator@8.0.1
Unpacked Size
691.69 kB
Size
135.10 kB
File Count
17
NPM Version
10.5.0
Node Version
22.9.0
Publised On
16 Oct 2024
Total Downloads
Cumulative downloads
Total Downloads
20,450,068
Last day
-78.1%
5,098
Compared to previous day
Last week
-38.3%
80,414
Compared to previous week
Last month
-5%
516,987
Compared to previous month
Last year
36.3%
6,464,845
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
1
Peer Dependencies
8
Dev Dependencies
34
ical-generator
is a small but fine library with which you can very easily create a valid iCal calendars, for example
to generate subscriptionable calendar feeds.
📦 Installation
npm install ical-generator
⚡️ Quick Start
1import ical, {ICalCalendarMethod} from 'ical-generator'; 2import http from 'node:http'; 3 4const calendar = ical({name: 'my first iCal'}); 5 6// A method is required for outlook to display event as an invitation 7calendar.method(ICalCalendarMethod.REQUEST); 8 9const startTime = new Date(); 10const endTime = new Date(); 11endTime.setHours(startTime.getHours()+1); 12calendar.createEvent({ 13 start: startTime, 14 end: endTime, 15 summary: 'Example Event', 16 description: 'It works ;)', 17 location: 'my room', 18 url: 'http://sebbo.net/' 19}); 20 21http.createServer((req, res) => { 22 res.writeHead(200, { 23 'Content-Type': 'text/calendar; charset=utf-8', 24 'Content-Disposition': 'attachment; filename="calendar.ics"' 25 }); 26 27 res.end(calendar.toString()); 28}).listen(3000, '127.0.0.1', () => { 29 console.log('Server running at http://127.0.0.1:3000/'); 30});
See the examples folder for more examples.
📑 API-Reference
🕒 Date, Time & Timezones
ical-generator supports native Date,
Day.js, Luxon's DateTime
and the older moment.js and moment-timezone
objects. You can also pass a string which is then passed to javascript's Date
internally.
It is recommended to use UTC time as far as possible. ical-generator
will output all time information as UTC time as
long as no time zone is defined. For day.js, a plugin is necessary for this, which is a prerequisite. If a time zone is
set, ical-generator
assumes that the given time matches the time zone. If a time zone is used, it is also recommended
to use a VTimezone generator. Such a function generates a VTimezone entry and returns it. For example, ical-timezones can
be used for this:
1import {ICalCalendar} from 'ical-generator'; 2import {getVtimezoneComponent} from '@touch4it/ical-timezones'; 3 4const cal = new ICalCalendar(); 5cal.timezone({ 6 name: 'FOO', 7 generator: getVtimezoneComponent 8}); 9cal.createEvent({ 10 start: new Date(), 11 timezone: 'Europe/London' 12});
If a moment-timezone
object or Luxon's setZone
method works, ical-generator
sets it according to the time zone set
in the calendar/event.
🚦 Tests
npm test
npm run coverage
🙋 FAQ
Where's the changelog?
It's here. If you need the changelog for
ical-generator
1.x.x and older, you'll find it here.
I get a ReferenceError: TextEncoder is not defined
error (in some browsers)
This library uses TextEncoder
, which
is available in node.js ≥ 11.0.0 and all modern browsers.
Outdated browsers may not have the necessary API and generate this error when generating the calendar.
🙆🏼♂️ Copyright and license
Copyright (c) Sebastian Pekarek under the MIT license.
No vulnerabilities found.
Reason
30 commit(s) and 4 issue activity found in the last 90 days -- score normalized to 10
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
packaging workflow detected
Details
- Info: Project packages its releases by way of GitHub Actions.: .github/workflows/test-release.yml:67
Reason
4 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36
Reason
dependency not pinned by hash detected -- score normalized to 4
Details
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/dependabot-auto-merge.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/sebbo2002/ical-generator/dependabot-auto-merge.yml/develop?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/is-semantic-pr.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/sebbo2002/ical-generator/is-semantic-pr.yml/develop?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release-bot.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/sebbo2002/ical-generator/release-bot.yml/develop?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release-bot.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/sebbo2002/ical-generator/release-bot.yml/develop?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release-bot.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/sebbo2002/ical-generator/release-bot.yml/develop?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/stale-issues.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/sebbo2002/ical-generator/stale-issues.yml/develop?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/template-updater.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/sebbo2002/ical-generator/template-updater.yml/develop?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-release.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/sebbo2002/ical-generator/test-release.yml/develop?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-release.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/sebbo2002/ical-generator/test-release.yml/develop?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-release.yml:38: update your workflow using https://app.stepsecurity.io/secureworkflow/sebbo2002/ical-generator/test-release.yml/develop?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-release.yml:40: update your workflow using https://app.stepsecurity.io/secureworkflow/sebbo2002/ical-generator/test-release.yml/develop?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-release.yml:57: update your workflow using https://app.stepsecurity.io/secureworkflow/sebbo2002/ical-generator/test-release.yml/develop?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-release.yml:59: update your workflow using https://app.stepsecurity.io/secureworkflow/sebbo2002/ical-generator/test-release.yml/develop?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-release.yml:83: update your workflow using https://app.stepsecurity.io/secureworkflow/sebbo2002/ical-generator/test-release.yml/develop?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-release.yml:85: update your workflow using https://app.stepsecurity.io/secureworkflow/sebbo2002/ical-generator/test-release.yml/develop?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/test-release.yml:103: update your workflow using https://app.stepsecurity.io/secureworkflow/sebbo2002/ical-generator/test-release.yml/develop?enable=pin
- Info: 0 out of 12 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 4 third-party GitHubAction dependencies pinned
- Info: 5 out of 5 npmCommand dependencies pinned
Reason
Found 0/9 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: topLevel 'contents' permission set to 'write': .github/workflows/dependabot-auto-merge.yml:5
- Warn: no topLevel permission defined: .github/workflows/is-semantic-pr.yml:1
- Warn: no topLevel permission defined: .github/workflows/release-bot.yml:1
- Warn: no topLevel permission defined: .github/workflows/stale-issues.yml:1
- Warn: no topLevel permission defined: .github/workflows/template-updater.yml:1
- Warn: no topLevel permission defined: .github/workflows/test-release.yml:1
- Info: no jobLevel write permissions found
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'develop'
- Warn: branch protection not enabled for branch 'main'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 22 are checked with a SAST tool
Score
4.6
/10
Last Scanned on 2024-12-16
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn MoreOther packages similar to ical-generator
ics
iCal (ics) file generator
@flowr-es/ical-generator
ical-generator is a small piece of code which generates ical calendar files
timezones-ical-library
Easy direct access to the most recent official timezone information for iCalendar files via JavaScript
ical-toolkit
ICal generator/updater/parser with Timezone/DST, Alams, Organizers, Events, etc. support.