Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ics

Package Overview
Dependencies
Maintainers
1
Versions
102
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ics

iCal (ics) file generator

  • 3.8.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
146K
decreased by-9.51%
Maintainers
1
Weekly downloads
 
Created

What is ics?

The 'ics' npm package is used to create and manage iCalendar (.ics) files. These files are commonly used for sharing calendar events and scheduling information. The package provides a simple API to generate .ics files programmatically.

What are ics's main functionalities?

Create a Simple Event

This feature allows you to create a simple calendar event with various details such as start time, duration, title, description, location, and attendees. The code sample demonstrates how to define an event object and generate an .ics file using the 'ics' package.

const ics = require('ics');

const event = {
  start: [2023, 10, 5, 6, 30],
  duration: { hours: 1, minutes: 30 },
  title: 'Meeting with Bob',
  description: 'Discuss project updates',
  location: 'Office',
  url: 'http://example.com',
  geo: { lat: 40.0095, lon: -105.2669 },
  categories: ['Work'],
  status: 'CONFIRMED',
  busyStatus: 'BUSY',
  organizer: { name: 'Alice', email: 'alice@example.com' },
  attendees: [
    { name: 'Bob', email: 'bob@example.com', rsvp: true }
  ]
};

ics.createEvent(event, (error, value) => {
  if (error) {
    console.log(error);
    return;
  }
  console.log(value);
});

Create a Recurring Event

This feature allows you to create a recurring event. The code sample demonstrates how to define an event object with a recurrence rule to generate a weekly recurring event using the 'ics' package.

const ics = require('ics');

const event = {
  start: [2023, 10, 5, 6, 30],
  duration: { hours: 1, minutes: 30 },
  title: 'Weekly Team Meeting',
  description: 'Discuss weekly updates',
  location: 'Office',
  recurrenceRule: 'FREQ=WEEKLY;BYDAY=MO',
  organizer: { name: 'Alice', email: 'alice@example.com' },
  attendees: [
    { name: 'Bob', email: 'bob@example.com', rsvp: true }
  ]
};

ics.createEvent(event, (error, value) => {
  if (error) {
    console.log(error);
    return;
  }
  console.log(value);
});

Create Multiple Events

This feature allows you to create multiple events at once. The code sample demonstrates how to define an array of event objects and generate multiple .ics files using the 'ics' package.

const ics = require('ics');

const events = [
  {
    start: [2023, 10, 5, 6, 30],
    duration: { hours: 1, minutes: 30 },
    title: 'Meeting with Bob',
    description: 'Discuss project updates',
    location: 'Office',
    organizer: { name: 'Alice', email: 'alice@example.com' },
    attendees: [
      { name: 'Bob', email: 'bob@example.com', rsvp: true }
    ]
  },
  {
    start: [2023, 10, 6, 9, 0],
    duration: { hours: 2, minutes: 0 },
    title: 'Client Presentation',
    description: 'Present the new project proposal',
    location: 'Client Office',
    organizer: { name: 'Alice', email: 'alice@example.com' },
    attendees: [
      { name: 'Client', email: 'client@example.com', rsvp: true }
    ]
  }
];

ics.createEvents(events, (error, value) => {
  if (error) {
    console.log(error);
    return;
  }
  console.log(value);
});

Other packages similar to ics

Keywords

FAQs

Package last updated on 24 Sep 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc