Socket
Socket
Sign inDemoInstall

google-calendar-generator

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

google-calendar-generator

This is just a side project I did for adding events to my personal Google Calendar using the Google API. I was tired of adding multiple events all with the same configuration and having to go back and update all of them when manually I wanted to make chan


Version published
Maintainers
1
Created
Source

google-calendar-helper

This is just a side project I did for adding events to my personal Google Calendar using the Google API. I was tired of adding multiple events all with the same configuration and having to go back and update all of them when manually I wanted to make changes.

Disclaimer: The library isn't necessarily comprehensive in covering all of Google Calendar's available APIs, does not have test cases, and may not be generic in all scenarios; this was primarily made for my own use cases.

Usage

  1. Follow only Step 1 of Google's Node.js Quickstart. This will result in a credentials.json file.
  2. Run the following command anywhere in your terminal
npx google-calendar-generator --credentials ./PATH/TO/credentials.json --token ./PATH/TO/token.json --config ./PATH/TO/config.js

NOTE: The first time you run the program, you will not have a token.json. For the --token, just specify where you would like the token.json to be auto-generated.

  1. Check out your new calendar at https://calendar.google.com/

See ex-calendar-config.js for an example calendar configuration

Calendar Configuration Documentation

module.exports = [
  {
    name: "Example Calendar #1",
    /**
     * Int from 1 - 11
     * https://developers.google.com/calendar/v3/reference/colors/get?apix=true#try-it
     */
    colorId: 1,
    /**
     * If true, deletes any existing calendars with the same name
     * and recreates it. If false, adds events to any existing
     * calendar with the same name
     */
    recreateCalendar: false,
    /**
     * If true, deletes any existing events with the same name
     * and recreates it. If false, skips adding the event to
     * prevent creating duplicate events.
     */
    recreateEvents: false,
    events: [
      {
        summary: "Event #1",
        /**
         * Date formatted YEAR-MONTH-DAY
         */
        date: "2000-01-31",
        /**
         * String value. How often the event occurs
         * - DAILY
         * - WEEKLY
         * - BiWEEKLY
         * - MONTHLY
         * - QUARTERLY
         * - YEARLY
         * If none of the above are provided, you can supply your own. For example:
         *    recurrence: { rule: ["RRULE:FREQ=DAILY"] }
         * See "recurrence"
         * https://developers.google.com/calendar/v3/reference/events/insert#request-body
         */
        recurrence: "YEARLY",
        /**
         * Array of reminders
         * Each reminder is an object containing:
         * - method: email | popup
         * - weeksBefore or minutesBefore: int
         */
        reminders: [
          { method: "email", weeksBefore: 4 },
          { method: "email", weeksBefore: 3 },
          { method: "popup", weeksBefore: 2 },
          { method: "popup", weeksBefore: 1 }
        ]
      }
    ]
  },
  {
    name: "Example Calendar #2",
    colorId: 10,
    recreateCalendar: true,
    events: [
      {
        summary: "Event #1",
        date: "2000-12-25",
        recurrence: "YEARLY",
        reminders: [
          { method: "email", minutesBefore: 4 },
          { method: "email", minutesBefore: 3 },
          { method: "popup", minutesBefore: 2 },
          { method: "popup", minutesBefore: 1 }
        ]
      }
    ]
  }
];

References

FAQs

Package last updated on 04 Dec 2019

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