mirror of
https://github.com/comatory/fb2iCal
synced 2024-12-29 09:50:55 +01:00
22 lines
428 B
JavaScript
22 lines
428 B
JavaScript
const ics = require('ics')
|
|
|
|
const generateICS = async(data) => {
|
|
return new Promise((resolve, reject) => {
|
|
ics.createEvent({
|
|
title: data.title || '',
|
|
start: data.start || [],
|
|
duration: data.duration || { hours: 2 },
|
|
location: data.location || '',
|
|
}, (err, value) => {
|
|
if (err) {
|
|
reject(err)
|
|
return
|
|
}
|
|
|
|
resolve(value)
|
|
})
|
|
})
|
|
}
|
|
|
|
module.exports = generateICS
|