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

time-handler

v1.1.1

Published

Check time spend on your activities using Google Calendar easily!

Downloads

2

Readme

time-handler

Contents

About

Time-handler is simple console application to count time spent on events from Google Calendar. Based on official Google tutorial

Requirements

  • node.js
  • npm

Installation

npm i -g time-handler

Usage

You have to input some data (date range and users) to make time-handler working. There are 3 ways to input data:

  • CLI arguments (highest priority)
  • environment variables
  • .env file (from dotenv package style) (less priority than environment variables)
  • app inputs (available only when variable is not defined by other way)

CLI

To run app you can use:

time-handler <args>

from directory with time-handler

examples

time-handler --help
time-handler -S 2021-04-06 -e 2021-04-08 -u "[email protected] as User1, [email protected]"
time-handler --this_month -u [email protected]

options

  • --token/-T/-t - [string] Name of token json file
  • --client_id - [string] Google API client ID
  • --client_secret - [string] Google API client secret
  • --redirect_uri - [string] Google API redirect_uri (first element of array)
  • --hourly_rate - [number] Hourly rate (if value 1 money reward in summary will be skipped)
  • --start/-S/-s - [string] [YYYY-MM-DD] (or any string parsable to JS Date object) - Start date (of date range)
  • --end/-E/-e - [string] [YYYY-MM-DD] (or any string parsable to JS Date object) - End date (of date range)
  • --users/--user/-U/-u - [string] Calendar ID (mostly email address), optionally you can set alias f.e. [email protected] as User One. If you have many users use coma as separator f.e [email protected] as User One, [email protected] (in this case [email protected] won't have alias)
  • --this_month - [boolean] Set date range to this month (overwrite others dates)
  • --verbose - [boolean] Print events summary

Environment varibles:

Every value set by CLI options can be set in environment variables also.

List of variables:

  • TOKEN
  • CLIENT_ID
  • CLIENT_SECRET
  • REDIRECT_URI
  • HOURLY_RATE
  • START
  • END
  • USERS
  • THIS_MONTH
  • VERBOSE

Application inputs

If you didn't set date range or users application will ask you about missing value, you can just type value and press enter.

First run

If you run app first time, you will be asked for access token (and API's credentials if you didn't set it, (check a tutorial how to get the credentials)). To generate it follow the messages that app will print:

Authorize this app by visiting this url: https://[...]

Open link, grant access to Time-handler and copy token generated by Google Calendar and paste it after:

Enter the code from that page here:

New token

If you want to generate new token (for new account) you need to set new token file name. You can do it by --token CLI option or TOKEN environment variable. By default token file will be named as token.json.

Config files

Config files (.env, token.json(or named differently)) are stored in:

Windows: C:/Users/(user)/.local/share/.time-handler

Linux: /home/(user)/.local/share/.time-handler

Powershell, Git Bash, Bash:

cd $HOME/.local/share/.time-handler

cmd:

cd %USERPROFILE%/.local/share/.time-handler