npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

google-calendar-generator

v2.1.0

Published

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

Downloads

5

Readme

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