Giter Site home page Giter Site logo

adamgibbons / ics Goto Github PK

View Code? Open in Web Editor NEW
682.0 13.0 152.0 1.02 MB

iCalendar (ics) file generator for node.js

License: ISC License

JavaScript 99.93% Ruby 0.07%
icalendar ical ics ics-ical javascript alarm calendar calendar-events vevent vcalendar

ics's Introduction

ics

The iCalendar generator

npm version TravisCI build status Downloads

Install

npm install -S ics

Example Usage

In node / CommonJS

  1. Create an iCalendar event:
const ics = require('ics')
// or, in ESM: import * as ics from 'ics'

const event = {
  start: [2018, 5, 30, 6, 30],
  duration: { hours: 6, minutes: 30 },
  title: 'Bolder Boulder',
  description: 'Annual 10-kilometer run in Boulder, Colorado',
  location: 'Folsom Field, University of Colorado (finish line)',
  url: 'http://www.bolderboulder.com/',
  geo: { lat: 40.0095, lon: 105.2669 },
  categories: ['10k races', 'Memorial Day Weekend', 'Boulder CO'],
  status: 'CONFIRMED',
  busyStatus: 'BUSY',
  organizer: { name: 'Admin', email: '[email protected]' },
  attendees: [
    { name: 'Adam Gibbons', email: '[email protected]', rsvp: true, partstat: 'ACCEPTED', role: 'REQ-PARTICIPANT' },
    { name: 'Brittany Seaton', email: '[email protected]', dir: 'https://linkedin.com/in/brittanyseaton', role: 'OPT-PARTICIPANT' }
  ]
}

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

  console.log(value)
})
// BEGIN:VCALENDAR
// VERSION:2.0
// CALSCALE:GREGORIAN
// PRODID:adamgibbons/ics
// METHOD:PUBLISH
// X-PUBLISHED-TTL:PT1H
// BEGIN:VEVENT
// UID:S8h0Vj7mTB74p9vt5pQzJ
// SUMMARY:Bolder Boulder
// DTSTAMP:20181017T204900Z
// DTSTART:20180530T043000Z
// DESCRIPTION:Annual 10-kilometer run in Boulder\, Colorado
// X-MICROSOFT-CDO-BUSYSTATUS:BUSY
// URL:http://www.bolderboulder.com/
// GEO:40.0095;105.2669
// LOCATION:Folsom Field, University of Colorado (finish line)
// STATUS:CONFIRMED
// CATEGORIES:10k races,Memorial Day Weekend,Boulder CO
// ORGANIZER;CN=Admin:mailto:[email protected]
// ATTENDEE;RSVP=TRUE;ROLE=REQ-PARTICIPANT;PARTSTAT=ACCEPTED;CN=Adam Gibbons:mailto:[email protected]
// ATTENDEE;RSVP=FALSE;ROLE=OPT-PARTICIPANT;DIR=https://linkedin.com/in/brittanyseaton;CN=Brittany
//   Seaton:mailto:[email protected]
// DURATION:PT6H30M
// END:VEVENT
// END:VCALENDAR
  1. Write an iCalendar file:
const { writeFileSync } = require('fs')
const ics = require('ics')

ics.createEvent({
  title: 'Dinner',
  description: 'Nightly thing I do',
  busyStatus: 'FREE',
  start: [2018, 1, 15, 6, 30],
  duration: { minutes: 50 }
}, (error, value) => {
  if (error) {
    console.log(error)
  }

  writeFileSync(`${__dirname}/event.ics`, value)
})
  1. Create multiple iCalendar events:
const ics = require('./dist')

const { error, value } = ics.createEvents([
  {
    title: 'Lunch',
    start: [2018, 1, 15, 12, 15],
    duration: { minutes: 45 }
  },
  {
    title: 'Dinner',
    start: [2018, 1, 15, 12, 15],
    duration: { hours: 1, minutes: 30 }
  }
])

if (error) {
  console.log(error)
  return
}

console.log(value)
// BEGIN:VCALENDAR
// VERSION:2.0
// CALSCALE:GREGORIAN
// PRODID:adamgibbons/ics
// METHOD:PUBLISH
// X-PUBLISHED-TTL:PT1H
// BEGIN:VEVENT
// UID:pP83XzQPo5RlvjDCMIINs
// SUMMARY:Lunch
// DTSTAMP:20230917T142209Z
// DTSTART:20180115T121500Z
// DURATION:PT45M
// END:VEVENT
// BEGIN:VEVENT
// UID:gy5vfUVv6wjyBeNkkFmBX
// SUMMARY:Dinner
// DTSTAMP:20230917T142209Z
// DTSTART:20180115T121500Z
// DURATION:PT1H30M
// END:VEVENT
// END:VCALENDAR
  1. Create iCalendar events with Audio (Mac):
let ics = require("ics")
let moment = require("moment")
let events = []
let alarms = []

let start = moment().format('YYYY-M-D-H-m').split("-").map((a) => parseInt(a))
let end = moment().add({'hours':2, "minutes":30}).format("YYYY-M-D-H-m").split("-").map((a) => parseInt(a))

alarms.push({
  action: 'audio',
  description: 'Reminder',
  trigger: {hours:2,minutes:30,before:true},
  repeat: 2,
  attachType:'VALUE=URI',
  attach: 'Glass'
})

let event = {
  productId:"myCalendarId",
  uid: "123"+"@ics.com",
  startOutputType:"local",
  start: start,
  end: end,
  title: "test here",
  alarms: alarms
}
events.push(event)
console.log(ics.createEvents(events).value)

// BEGIN:VCALENDAR
// VERSION:2.0
// CALSCALE:GREGORIAN
// PRODID:myCalendarId
// METHOD:PUBLISH
// X-PUBLISHED-TTL:PT1H
// BEGIN:VEVENT
// UID:[email protected]
// SUMMARY:test here
// DTSTAMP:20230917T142621Z
// DTSTART:20230917T152600
// DTEND:20230917T175600
// BEGIN:VALARM
// ACTION:AUDIO
// REPEAT:2
// DESCRIPTION:Reminder
// ATTACH;VALUE=URI:Glass
// TRIGGER:-PT2H30M\nEND:VALARM
// END:VEVENT
// END:VCALENDAR

Using ESModules & in the browser

import { createEvent} from 'ics';

const event = {
  ...
}

async function handleDownload() {
  const filename = 'ExampleEvent.ics'
  const file = await new Promise((resolve, reject) => {
    createEvent(event, (error, value) => {
      if (error) {
        reject(error)
      }

      resolve(new File([value], filename, { type: 'text/calendar' }))
    })
  })
  const url = URL.createObjectURL(file);

  // trying to assign the file URL to a window could cause cross-site
  // issues so this is a workaround using HTML5
  const anchor = document.createElement('a');
  anchor.href = url;
  anchor.download = filename;

  document.body.appendChild(anchor);
  anchor.click();
  document.body.removeChild(anchor);

  URL.revokeObjectURL(url);
}

API

createEvent(attributes[, callback])

Generates an iCal-compliant VCALENDAR string with one VEVENT. If a callback is not provided, returns an object having the form { error, value }, where value contains an iCal-compliant string if there are no errors. If a callback is provided, returns a Node-style callback.

attributes

Object literal containing event information. Only the start property is required.

Note all date/time fields can be the array form, or a number representing the unix timestamp in milliseconds (e.g. getTime() on a Date).

The following properties are accepted:

Property Description Example
start Required. Date and time at which the event begins. [2000, 1, 5, 10, 0] (January 5, 2000) or a number
startInputType Type of the date/time data in start:
local (default): passed data is in local time.
utc: passed data is UTC
startOutputType Format of the start date/time in the output:
utc (default): the start date will be sent in UTC format.
local: the start date will be sent as "floating" (form #1 in RFC 5545)
end Time at which event ends. Either end or duration is required, but not both. [2000, 1, 5, 13, 5] (January 5, 2000 at 1pm) or a number
endInputType Type of the date/time data in end:
local: passed data is in local time.
utc: passed data is UTC.
The default is the value of startInputType
endOutputType Format of the start date/time in the output:
utc: the start date will be sent in UTC format.
local: the start date will be sent as "floating" (form #1 in RFC 5545).
The default is the value of startOutputType
duration How long the event lasts. Object literal having form { weeks, days, hours, minutes, seconds } Either end or duration is required, but not both. { hours: 1, minutes: 45 } (1 hour and 45 minutes)
title Title of event. 'Code review'
description Description of event. 'A constructive roasting of those seeking to merge into master branch'
location Intended venue Mountain Sun Pub and Brewery
geo Geographic coordinates (lat/lon) { lat: 38.9072, lon: 77.0369 }
url URL associated with event 'http://www.mountainsunpub.com/'
status Three statuses are allowed: TENTATIVE, CONFIRMED, CANCELLED CONFIRMED
organizer Person organizing the event { name: 'Adam Gibbons', email: '[email protected]', dir: 'https://linkedin.com/in/adamgibbons', sentBy: '[email protected]' }
attendees Persons invited to the event [{ name: 'Mo', email: '[email protected]', rsvp: true }, { name: 'Bo', email: '[email protected]', dir: 'https://twitter.com/bo1234', partstat: 'ACCEPTED', role: 'REQ-PARTICIPANT' }]
categories Categories associated with the event ['hacknight', 'stout month']
alarms Alerts that can be set to trigger before, during, or after the event. The following attach properties work on Mac OS: Basso, Blow, Bottle, Frog, Funk, Glass, Hero, Morse, Ping, Pop, Purr, Sousumi, Submarine, Tink { action: 'display', description: 'Reminder', trigger: [2000, 1, 4, 18, 30] } OR { action: 'display', description: 'Reminder', trigger: { hours: 2, minutes: 30, before: true } } OR { action: 'display', description: 'Reminder', trigger: { hours: 2, minutes: 30, before: false } OR { action: 'audio', description: 'Reminder', trigger: { hours: 2, minutes: 30, before: true }, repeat: 2, attachType: 'VALUE=URI', attach: 'Glass' }
productId Product which created ics, PRODID field 'adamgibbons/ics'
uid Universal unique id for event, produced by default with nanoid. Warning: This value must be globally unique. It is recommended that it follow the RFC 822 addr-spec (i.e. localpart@domain). Including the @domain half is a good way to ensure uniqueness. 'LZfXLFzPPR4NNrgjlWDxn'
method This property defines the iCalendar object method associated with the calendar object. When used in a MIME message entity, the value of this property MUST be the same as the Content-Type "method" parameter value. If either the "METHOD" property or the Content-Type "method" parameter is specified, then the other MUST also be specified. PUBLISH
recurrenceRule A recurrence rule, commonly referred to as an RRULE, defines the repeat pattern or rule for to-dos, journal entries and events. If specified, RRULE can be used to compute the recurrence set (the complete set of recurrence instances in a calendar component). You can use a generator like this one. FREQ=DAILY
exclusionDates Array of date-time exceptions for recurring events, to-dos, journal entries, or time zone definitions. [[2000, 1, 5, 10, 0], [2000, 2, 5, 10, 0]] OR [1694941727477, 1694945327477]
sequence For sending an update for an event (with the same uid), defines the revision sequence number. 2
busyStatus Used to specify busy status for Microsoft applications, like Outlook. See Microsoft spec. 'BUSY' OR 'FREE' OR 'TENTATIVE' OR 'OOF'
transp Used to specify event transparency (does event consume actual time of an individual). Used by Google Calendar to determine if event should change attendees availability to 'Busy' or not. 'TRANSPARENT' OR 'OPAQUE'
classification This property defines the access classification for a calendar component. See iCalender spec. 'PUBLIC' OR 'PRIVATE' OR 'CONFIDENTIAL' OR any non-standard string
created Date-time representing event's creation date. Provide a date-time in local time [2000, 1, 5, 10, 0] or a number
lastModified Date-time representing date when event was last modified. Provide a date-time in local time [2000, 1, 5, 10, 0] or a number
calName Specifies the calendar (not event) name. Used by Apple iCal and Microsoft Outlook; see Open Specification 'Example Calendar'
htmlContent Used to include HTML markup in an event's description. Standard DESCRIPTION tag should contain non-HTML version. <!DOCTYPE html><html><body><p>This is<br>test<br>html code.</p></body></html>

To create an all-day event, pass only three values (year, month, and date) to the start and end properties. The date of the end property should be the day after your all-day event. For example, in order to create an all-day event occuring on October 15, 2018:

const eventAttributes = {
  start: [2018, 10, 15],
  end: [2018, 10, 16],
  /* rest of attributes */
}

callback

Optional. Node-style callback.

function (err, value) {
  if (err) {
    // if iCal generation fails, err is an object containing the reason
    // if iCal generation succeeds, err is null
  }

  console.log(value) // iCal-compliant text string
}

createEvents(events[, headerParams, callback])

Generates an iCal-compliant VCALENDAR string with multiple VEVENTS.

headerParams may be omitted, and in this case they will be read from the first event.

If a callback is not provided, returns an object having the form { error, value }, where value is an iCal-compliant text string if error is null.

If a callback is provided, returns a Node-style callback.

events

Array of attributes objects (as described in createEvent).

callback

Optional. Node-style callback.

function (err, value) {
  if (err) {
    // if iCal generation fails, err is an object containing the reason
    // if iCal generation succeeds, err is null
  }

  console.log(value) // iCal-compliant text string
}

Develop

Run mocha tests and watch for changes:

npm start

Run tests once and exit:

npm test

Build the project, compiling all ES6 files within the src directory into vanilla JavaScript in the dist directory.

npm run build

References

ics's People

Contributors

adamgibbons avatar akumzy avatar davidschlachter avatar dependabot[bot] avatar drewtunes avatar duvel avatar elreeda avatar employee451 avatar fholzer avatar ggascoigne avatar heyfrench avatar ibc avatar jasonhumphrey2 avatar jcaron23 avatar kolarski avatar lavluda avatar leodutra avatar m-vinc avatar olegwock avatar remcohaszing avatar rh389 avatar rhnorskov avatar rpunkfu avatar ryanwitt avatar svnindia avatar talater avatar tiagomartinho avatar tie23 avatar timmysze avatar tjenkinson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ics's Issues

Explain attribute "startType" (utc dates)

It took me quite a while to realize that i have to set the attribute startType to local in order to keep my UTC dates without conversion. It would be nice if the README would mention this feature

example in README file will not validate

Just a quickie for a tiny documentation problem:

In your fourth example, 4. Create iCalendar events with Audio (Mac) you provide this code

let start = moment().format('YYYY-M-D').split("-")
let end = moment().add({'hours':2, "minutes":30}).format("YYYY-M-D").split("-")

You format the date using only year, month and date, but the duration is in hours and minutes. The ICS validator refuses this, for obvious reasons. :-)

Being more precise in the formatting solves the problem:

let start = moment().format('YYYY-M-D-H-m').split("-")
let end = moment().add({'hours':2, "minutes":30}).format("YYYY-M-D-H-m").split("-")

Understanding default uid generation

Thanks for making this module.

Kind of new to Node.js. I'm trying to understand why the uuid's generated with uuid/v1 is the same for ICS files created around the same time. I'm wondering if this has something to do with how defaults is loaded?

For the life cycle of a node.js app, when is the uid in defaults actually generated? Seems the way defaults is using the uuid generator causes the uuid to be fixed for each time it is imported into buildEvent. An example quote from here:

> const before = { myProperty: uuid.v4() }
undefined
> before.myProperty
'bdf9794f-0897-48dd-8fed-da380dac6e74'

> const after = { myProperty: () => uuid.v4() }
undefined
> after.myProperty
[Function: myProperty]
> after.myProperty()
'40848bdb-7c04-40e2-8694-5513db705732'
> after.myProperty()
'd1edd511-6ce9-4a12-b196-4fafb6b3b16f'
> after.myProperty()
'1258559b-c082-436c-8ecb-f74679954ffd'
> // Etc ...

start date isssue when convert from json to ical

{ ValidationError: child "start" fails because ["start" at position 2 fails because ["2" must be larger than or equal to 1]]
my json is :-
{
title: element.id.name,
start: [year, day, hour, minutes, seconds],
duration: { minutes: minutes }
}

handle line breaks in description

New lines need to be converted in the description. I used this hack to get a valid multiline description:

ics.buildEvent({
  // ...
  description: myDescriptionString.replace(/(?:\r\n|\r|\n)/g, '\\n'),
  // ...
}

Newlines in Location

Similar to #31, newlines in location need to be handled. Otherwise, only the first line ends up in the actual calendar entry.

best practice for saving ICS files

It is said that files are saved in the "operating system's temporary directory". Was curious to know if you would recommend people to store these files elsewhere and how?
Thanks

Support for additional properties in calendar and event properties

Add the support for passing direct property params to an event or calendar. For add more possibilities of the standard: https://tools.ietf.org/html/rfc5545

For example:

var events = [
    {
        uid: '-UnitID-123456',
        title: 'Event 123456',
        created: '',// Not implemented yet
        start: [2018, 1, 15, 2, 30],
        end: [2018, 1, 17, 2, 30],
        description: 'Event description',
        additionals: [
           // For add in VEVENT: 'CREATED:20171019T171332Z'
           {
               attribute: 'CREATED',
               value: '20171019T171332Z'
           } 
    }
];
var properties = {
    productId: `-//Product//Unique-ID-1//EN`
};
ics.createCalendar(events, properties, callback);

Build task is not working

When installing the package from npm, the dist folder doesn't contain the latest changes. For example, in version 2.7.1 the change which let us customize the request attribute doesn't appear.

update dependencies to @hapi/joi

Hello,
any chance to update 'join' dependency to @hapi/joi?
Since:

This module has moved and is now available at @hapi/joi.

Thanks a lot
Ognian

Organizer doesn't work

The organizer field was added in ade14c6, but doesn't seem to work anymore.

e.g., ran ex/app.js to create ics file by accessing /create endpoint. options for the new event includes:

organizer: {
            'name': 'greenpioneersolutions',
            email: '[email protected]'
        },

but outputted file does not contain the organizer:

BEGIN:VCALENDAR
VERSION:2.0
CALSCALE:GREGORIAN
PRODID:-//Adam Gibbons//agibbons.com//ICS: iCalendar Generator
BEGIN:VEVENT
UID:9427cc00-1335-11e7-bee7-5b486358a7d2
DTSTAMP:20170327T213729Z
DTSTART:20170327
DTEND:20170328
DESCRIPTION:Meet Down at the index.js
LOCATION:Fort Worth, Texas
ATTENDEE;CN=Support greenpioneersolutions:mailto:[email protected]
ATTENDEE;CN=no RSVP greenpioneersolutions:mailto:[email protected]
END:VEVENT
END:VCALENDAR

Colons should not be escaped in TEXT property values

Great library. I noticed the \ was showing up in my descriptions in Calendar.app, so I did a little digging and found this in the RFC. I'll try to get a PR in this week, but I wanted to document it just in case I can't.

From the RFC:

However, a COLON character in a "TEXT" property value SHALL NOT be escaped with a BACKSLASH character.

Offending line: last .replace() in https://github.com/adamgibbons/ics/blob/master/src/utils/set-description.js#L2

Unsafe numbers on start

Sometimes, I get the following error:

{ ValidationError: child "start" fails because ["start" at position 4 fails because ["4" must be a safe number]]
    at Object.exports.process (c:\NodeInvitation\node_modules\joi\lib\errors.js:203:19)
    at _validateWithOptions (c:\NodeInvitation\node_modules\joi\lib\types\any\index.js:764:31)
    at internals.root.root.validate (c:\NodeInvitation\node_modules\joi\lib\index.js:147:23)
    at validateEvent (c:\NodeInvitation\node_modules\ics\dist\schema\index.js:76:37)
    at validateAndBuildEvent (c:\NodeInvitation\node_modules\ics\dist\index.js:22:38)
    at Object.createEvent (c:\NodeInvitation\node_modules\ics\dist\index.js:102:32)
    at c:\NodeInvitation\Routes\fleetinvite.js:1580:37
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:446:3)
  isJoi: true,
  name: 'ValidationError',
  details: 
   [ { message: '"4" must be a safe number',
       path: [Object],
       type: 'number.unsafe',
       context: [Object] } ],
  _object: 
   { title: 'Tyre appointment',
     productId: 'adamgibbons/ics',
     method: 'PUBLISH',
     uid: 'd65705ff-2236-4321-8a48-76621f378ba0',
     timestamp: '20190404T114200Z',
     start: [ '2019', '04', '20', '08', '00' ],
     description: 'Test',
     startType: 'local',
     duration: { minutes: 60 } },
  annotate: [Function] }

I initialize an event with the following parameters:

{
title: 'Tyre appointment',
description: appfunctions.attemptToStringify(data[0].FIS_Description),
startType: 'local',
start: [appointmentMoment.format('YYYY'), appointmentMoment.format('MM'), appointmentMoment.format('DD'), appointmentMoment.format('HH'),appointmentMoment.format('mm')],
duration: { minutes: 60 }
}

I have solved this by adding parseInt() in front of every moment value.

I thought it was curious why the error is only thrown sometimes.

Timezone

How to use input time in particular timezone?
I can convert time to local timezone, but best way for me is to leave it in original timezone and use this for calendar

Module not found Error: Can't resolve 'dns'

Hello,

I am trying to use this library (many thanks by the way)

But as soon as I use the function ics.createEvent() I get a transpile error (see below)

Could you please help me overcome this.

Best regards.

ERROR in ./node_modules/isemail/lib/index.js
Module not found: Error: Can't resolve 'dns' in 'C:_dev\nsi\colibri\client\node_modules\isemail\lib'
resolve 'dns' in 'C:_dev\nsi\colibri\client\node_modules\isemail\lib'
Parsed request is a module
using description file: C:_dev\nsi\colibri\client\node_modules\isemail\package.json (relative path: ./lib)
Field 'browser' doesn't contain a valid alias configuration
after using description file: C:_dev\nsi\colibri\client\node_modules\isemail\package.json (relative path: ./lib)
resolve as module
C:_dev\nsi\colibri\client\node_modules\isemail\lib\node_modules doesn't exist or is not a directory
C:_dev\nsi\colibri\client\node_modules\isemail\node_modules doesn't exist or is not a directory
C:_dev\nsi\colibri\client\node_modules\node_modules doesn't exist or is not a directory
C:_dev\nsi\node_modules doesn't exist or is not a directory
C:_dev\node_modules doesn't exist or is not a directory
C:\node_modules doesn't exist or is not a directory
looking for modules in C:_dev\nsi\colibri\client\node_modules
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./node_modules)
Field 'browser' doesn't contain a valid alias configuration
after using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./node_modules)
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./node_modules/dns)
no extension
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\node_modules\dns doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\node_modules\dns.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\node_modules\dns.js doesn't exist
as directory
C:_dev\nsi\colibri\client\node_modules\dns doesn't exist
looking for modules in C:_dev\nsi\colibri\node_modules
using description file: C:_dev\nsi\colibri\package.json (relative path: ./node_modules)
Field 'browser' doesn't contain a valid alias configuration
after using description file: C:_dev\nsi\colibri\package.json (relative path: ./node_modules)
using description file: C:_dev\nsi\colibri\package.json (relative path: ./node_modules/dns)
no extension
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\node_modules\dns doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\node_modules\dns.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\node_modules\dns.js doesn't exist
as directory
C:_dev\nsi\colibri\node_modules\dns doesn't exist
looking for modules in C:_dev\nsi\colibri\client\node_modules
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./node_modules)
Field 'browser' doesn't contain a valid alias configuration
after using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./node_modules)
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./node_modules/dns)
no extension
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\node_modules\dns doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\node_modules\dns.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\node_modules\dns.js doesn't exist
as directory
C:_dev\nsi\colibri\client\node_modules\dns doesn't exist
looking for modules in C:_dev\nsi\colibri\client\src
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
Field 'browser' doesn't contain a valid alias configuration
after using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src/dns)
no extension
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.js doesn't exist
as directory
C:_dev\nsi\colibri\client\src\dns doesn't exist
looking for modules in C:_dev\nsi\colibri\client\src
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
Field 'browser' doesn't contain a valid alias configuration
after using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src/dns)
no extension
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.js doesn't exist
as directory
C:_dev\nsi\colibri\client\src\dns doesn't exist
looking for modules in C:_dev\nsi\colibri\client\src
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
Field 'browser' doesn't contain a valid alias configuration
after using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src/dns)
no extension
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.js doesn't exist
as directory
C:_dev\nsi\colibri\client\src\dns doesn't exist
looking for modules in C:_dev\nsi\colibri\client\src
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
Field 'browser' doesn't contain a valid alias configuration
after using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src/dns)
no extension
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.js doesn't exist
as directory
C:_dev\nsi\colibri\client\src\dns doesn't exist
looking for modules in C:_dev\nsi\colibri\client\src
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
Field 'browser' doesn't contain a valid alias configuration
after using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src/dns)
no extension
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.js doesn't exist
as directory
C:_dev\nsi\colibri\client\src\dns doesn't exist
looking for modules in C:_dev\nsi\colibri\client\src
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
Field 'browser' doesn't contain a valid alias configuration
after using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src/dns)
no extension
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.js doesn't exist
as directory
C:_dev\nsi\colibri\client\src\dns doesn't exist
looking for modules in C:_dev\nsi\colibri\client\src
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
Field 'browser' doesn't contain a valid alias configuration
after using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src/dns)
no extension
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.js doesn't exist
as directory
C:_dev\nsi\colibri\client\src\dns doesn't exist
looking for modules in C:_dev\nsi\colibri\client\src
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
Field 'browser' doesn't contain a valid alias configuration
after using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src/dns)
no extension
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.js doesn't exist
as directory
C:_dev\nsi\colibri\client\src\dns doesn't exist
looking for modules in C:_dev\nsi\colibri\client\src
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
Field 'browser' doesn't contain a valid alias configuration
after using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src/dns)
no extension
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.js doesn't exist
as directory
C:_dev\nsi\colibri\client\src\dns doesn't exist
looking for modules in C:_dev\nsi\colibri\client\src
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
Field 'browser' doesn't contain a valid alias configuration
after using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src/dns)
no extension
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.js doesn't exist
as directory
C:_dev\nsi\colibri\client\src\dns doesn't exist
looking for modules in C:_dev\nsi\colibri\client\src
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
Field 'browser' doesn't contain a valid alias configuration
after using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src/dns)
no extension
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.js doesn't exist
as directory
C:_dev\nsi\colibri\client\src\dns doesn't exist
looking for modules in C:_dev\nsi\colibri\client\src
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
Field 'browser' doesn't contain a valid alias configuration
after using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src/dns)
no extension
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.js doesn't exist
as directory
C:_dev\nsi\colibri\client\src\dns doesn't exist
looking for modules in C:_dev\nsi\colibri\client\src
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
Field 'browser' doesn't contain a valid alias configuration
after using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src/dns)
no extension
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.js doesn't exist
as directory
C:_dev\nsi\colibri\client\src\dns doesn't exist
looking for modules in C:_dev\nsi\colibri\client\src
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
Field 'browser' doesn't contain a valid alias configuration
after using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src/dns)
no extension
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.js doesn't exist
as directory
C:_dev\nsi\colibri\client\src\dns doesn't exist
looking for modules in C:_dev\nsi\colibri\client\src
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
Field 'browser' doesn't contain a valid alias configuration
after using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src/dns)
no extension
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.js doesn't exist
as directory
C:_dev\nsi\colibri\client\src\dns doesn't exist
looking for modules in C:_dev\nsi\colibri\client\src
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
Field 'browser' doesn't contain a valid alias configuration
after using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src/dns)
no extension
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.js doesn't exist
as directory
C:_dev\nsi\colibri\client\src\dns doesn't exist
[C:_dev\nsi\colibri\client\node_modules\isemail\lib\node_modules]
[C:_dev\nsi\colibri\client\node_modules\isemail\node_modules]
[C:_dev\nsi\colibri\client\node_modules\node_modules]
[C:_dev\nsi\node_modules]
[C:_dev\node_modules]
[C:\node_modules]
[C:_dev\nsi\colibri\client\node_modules\dns]
[C:_dev\nsi\colibri\node_modules\dns]
[C:_dev\nsi\colibri\client\node_modules\dns.ts]
[C:_dev\nsi\colibri\node_modules\dns.ts]
[C:_dev\nsi\colibri\client\node_modules\dns.js]
[C:_dev\nsi\colibri\node_modules\dns.js]
[C:_dev\nsi\colibri\client\node_modules\dns]
[C:_dev\nsi\colibri\node_modules\dns]
[C:_dev\nsi\colibri\client\node_modules\dns]
[C:_dev\nsi\colibri\client\node_modules\dns.ts]
[C:_dev\nsi\colibri\client\node_modules\dns.js]
[C:_dev\nsi\colibri\client\node_modules\dns]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns.ts]
[C:_dev\nsi\colibri\client\src\dns.js]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns.ts]
[C:_dev\nsi\colibri\client\src\dns.js]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns.ts]
[C:_dev\nsi\colibri\client\src\dns.js]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns.ts]
[C:_dev\nsi\colibri\client\src\dns.js]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns.ts]
[C:_dev\nsi\colibri\client\src\dns.js]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns.ts]
[C:_dev\nsi\colibri\client\src\dns.js]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns.ts]
[C:_dev\nsi\colibri\client\src\dns.js]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns.ts]
[C:_dev\nsi\colibri\client\src\dns.js]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns.ts]
[C:_dev\nsi\colibri\client\src\dns.js]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns.ts]
[C:_dev\nsi\colibri\client\src\dns.js]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns.ts]
[C:_dev\nsi\colibri\client\src\dns.js]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns.ts]
[C:_dev\nsi\colibri\client\src\dns.js]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns.ts]
[C:_dev\nsi\colibri\client\src\dns.js]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns.ts]
[C:_dev\nsi\colibri\client\src\dns.js]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns.ts]
[C:_dev\nsi\colibri\client\src\dns.js]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns.ts]
[C:_dev\nsi\colibri\client\src\dns.js]
[C:_dev\nsi\colibri\client\src\dns]
@ ./node_modules/isemail/lib/index.js 5:12-26
@ ./node_modules/joi/lib/types/string/index.js
@ ./node_modules/joi/lib/index.js
@ ./node_modules/ics/dist/schema/index.js
@ ./node_modules/ics/dist/pipeline/validate.js
@ ./node_modules/ics/dist/pipeline/index.js
@ ./node_modules/ics/dist/index.js
@ ./node_modules/ics/index.js
@ ./src/app/shared/service/tools.service.ts
@ ./src/app/app.module.ts
@ ./src/main.ts
@ multi ./src/main.ts

This library forces you to use files, correct?

Am I correct that this library forces you to write the data out to an ics file? I'm looking for something that just returns me a string or something and I can just stream it back to the user without having to write to a file.

Cherry pick methods from Lodash to reduce bundle size

It would be great if the lib cherry picks the lodash methods used to reduce bundle size.

Like:

// Cherry-pick methods for smaller browserify/rollup/webpack bundles.
const at = require('lodash/at');
const curryN = require('lodash/fp/curryN');

// OR
import at form 'lodash/at';
import curryN from 'lodash/fp/curryN';

instead of:

import _ from 'lodash';

Time zone support messes up in version 2.13

When upgrading from version 2.12.1 to 2.13.0, all my events that are created in local time now jumps ahead two hours when are viewed in Apple Calendar og on Google Calendar. I'm currently in the GMT+2 time zone, so an event that was supposed to begin 9.15 now starts at 11.15.

.ics filename

Can you please tell me if it is possible to change the name of .ics filename and how.

Thanks for your work.

Compatibility with Outlook and iOS

Hi,

I've started using this lib and it works great for Gmail. Email with ics attachment is recognized as meeting invite by Gmail, and special template for displaying meeting information is applied by Gmail.

Unfortunately, this does not happen when the same email with sam ics file is sent to [email protected] / iOS device. It's displayed as an ordinary email with an attachment. Polish popular email service poczta.wp.pl has the same problem.

What about MS Outlook? Will it recognize it or have same problem as Apple?

Timezones

When event is being added to iCal, the TZ is GMT by default. How to work with Timezones?

Typescript

Hi
Thank you for your module
Please add typescript support.

END:VCALENDAR is missing

END:VCALENDAR is missing from output when providing only one event in an array.

possible patch :
if (value.indexOf('END:VCALENDAR') == -1)
value += 'END:VCALENDAR';

const ics = require('ics')

const { error, value } = ics.createEvents([
{
title: 'Lunch',
start: [2018, 1, 15, 12, 15],
end: [2018, 1, 15, 13, 15],
}
])

// BEGIN:VCALENDAR
// VERSION:2.0
// CALSCALE:GREGORIAN
// PRODID:adamgibbons/ics
// METHOD:PUBLISH
// X-PUBLISHED-TTL:PT1H
// BEGIN:VEVENT
// UID:016344bc-a3f4-4cbe-ab97-e1847d232b39
// SUMMARY:Lunch
// DTSTAMP:20180530T180600Z
// DTSTART:20180115T111500Z
// DTEND:20180115T121500Z
// END:VEVENT

Why are ISO start times converted to iCal local time?

When I provide this library a start time in ISO format, the resulting iCal string has the start time as local time (Form #1 in the RFC, https://icalendar.org/iCalendar-RFC-5545/3-3-5-date-time.html). I would expect an absolute time to remain absolute in the resulting iCal string (Form #2). Specifically, what is the purpose of line 83 in lib/ics.js? How can I specify that the iCal string use form #2 when providing the start time in an absolute format?

is this supported in safari??

I'm having problems getting safari to name the file and not save as "unknown". it does go to the downloads however when opened it's in text/edit. On download i do get an error of 'Failed to load resource: Frame load interrupted' in the browser console.

Support for all day events

It's needed change the method for add start and end day for support all day events.
This is generating a DTSTART and DTEND in format YYYYMMDD without T000000Z, that is if the hour and second are no passed as param.

Library converts UTC to server time

Please correct me if I'm wrong, but when you are doing this in set-date-with-utc-time.js

const formattedDate = moment([
      year,
      month - 1,
      date,
      hours,
      minutes,
      seconds
    ]).utc().format('YYYYMMDDTHHmm00') + 'Z'

you are calling moment([...])which will interpret the inputs as local. i.e., hours is the time on my watch in new york, not utc.

shouldn't it be moment.utc([...])... ?

DIR or custom attributes not allowed within organizer/attendees

According to the spec, both organizer and attendee support DIR. Also, some calendar apps insert custom attributes (starting with X-).

However, ics fails when adding dir or any x-xxxx attribute. Example:

const ics = require('ics')

const event =
{
	start       : [ 2018, 5, 30, 6, 30 ],
	duration    : { hours: 6, minutes: 30 },
	title       : 'Bolder Boulder',
	description : 'Annual 10-kilometer run in Boulder, Colorado',
	location    : 'Bilbao',
	url         : 'https://meet.sync.work/qwe/asd?qwe=1234',
	organizer   :
	{
		name   : 'Manolo Foo',
		email  : '[email protected]',
		dir    : '1234-qwer-asdf',
		'x-id' : '1234-qwer-asdf'
	},
	attendees:
	[
		{
			name   : 'Adam Gibbons',
			email  : '[email protected]',
			dir    : '5678-rtty-dfgh',
			'x-id' : '5678-rtty-dfgh',
			rsvp   : true
		},
		{
			name   : 'Brittany Seaton',
			email  : '[email protected]',
			dir    : '9999-66666-tasd',
			'x-id' : '9999-66666-tasd'
		}
	]
};

ics.createEvent(event, (error, value) =>
{
	if (error)
	{
		console.error('ERROR:', error);

		return;
	}

	console.log(value);
});

It produces:

ERROR: { ValidationError: child "organizer" fails because ["dir" is not allowed, "x-id" is not allowed]
    at Object.exports.process (/private/tmp/node_modules/joi/lib/errors.js:181:19)
    at internals.Object._validateWithOptions (/private/tmp/node_modules/joi/lib/types/any/index.js:651:31)
    at module.exports.internals.Any.root.validate (/private/tmp/node_modules/joi/lib/index.js:121:23)
    at validateEvent (/private/tmp/node_modules/ics/dist/schema/index.js:72:37)
    at Object.createEvent (/private/tmp/node_modules/ics/dist/index.js:97:53)
    at Object.<anonymous> (/private/tmp/kk.js:36:5)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)

Resetting the `ics` for new usage

Hey @adamgibbons thanks for the nice library!

I have a data structure with many people and many events for each people. My use case is to generate a .ics file for each person containing the events under them. Looking at your documentation I don't see a way to do that. What I want:

  1. Iterate through my data structure (each person) (first loop)
  2. For each person, iterate through their events (second loop)
  3. Create events (ics.createEvent)
  4. Exit second loop && write .ics file for that person
  5. Repeat for next person

But as of today's API, after each file write on step 4, it would only be appending to the same global ics variable, hence each file write would contain the events for all previous persons instead of only theirs.

Would it be possible to add another api to reset the ics var? Or make it possible to make ics an instance (var ics = new ICS())?

Thanks!!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.