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

harvest-overtime

v3.0.0

Published

Track the overtime!

Downloads

16

Readme

harvest-overtime ⏰

npm version Build Status

Command-line interface to calculate employee's overtime with Harvest's CSV reports. Harvest is a service that provides time tracking and online invoicing tools for freelancers and small businesses.

Built with TypeScript and Node.js. Star me on GitHub — thanks! ⭐

✨ Features and Limitations

  • Supports Harvest's CSV reports.
  • Calculates overtime of employees: generates a report or prints to the command line. See an example.
  • Supports standard full-time work (40 hours per week: 8 hours per day). You can change this value. See an example.
  • Supports any reporting period. It can be a week or several months.
  • Includes total time per day. See an example.
  • Includes both weekdays and weekends. See an example.
  • It doesn't support national holidays.
  • Specific headers are required. See the next section.
  • Requires Node.js v12+.

📌 CSV Requirements

CSV reports should include at least the following data:

  • "Employee?": whether they are employees or not.
  • "First Name": the employees' first names.
  • "Last Name": the employees' last names.
  • "Date": the employees' date entries from Harvest.
  • "Hours": the employees' hours entries from Harvest.

Please make sure your CSV is using these headers. See an example.

🚀 How to Install

In order for you and your team to use this tool, you'll need to install Node.js. This tool requires Node.js v12+.

# Global so it can be called from anywhere
npm install -g harvest-overtime

You can also use npx to avoid pollution.

🏗 Usage

harvest-overtime -i [input-file] -o [output-file] -h [working-day-hours] -p

Where input-file and output-file are the path and file for the input and output. If these file paths are not provided, it will use the following:

  • input: harvest.csv
  • output: report.csv

The -h option sets the working-day-hours. This value defines the regular working day hours in order to calculate the overtime. If the value is not provided, it will use 8 hours per day.

This tool generates a report file, but you can add -p to print the report to the command line.

🔨 Command Line Interface

Usage: harvest-overtime [options]

Options:
  -V, --version           output the version number
  -i, --input [input]     Path and name of the incoming CSV file. If not provided, will be 'harvest.csv'
  -o, --output [output]   Path and name of the resulting CSV file. If not provided, will be 'report.csv'
  -h, --dayhours [output] Regular working day hours. If not provided, will be '8 hours'
  -p, --print             Print report to the standard output. If not set, it won't print the report
  -h, --help              output usage information

📚 Examples

The Harvest report includes the following data entries. Please note that this is an extract from the CSV file.

| Employee? | First Name | Last Name | Date | Hours | | --------- | ---------- | --------- | ---------- | ----- | | Yes | Jane | Austen | 2018-08-06 | 4 | | Yes | Jane | Austen | 2018-08-06 | 4.5 | | Yes | Jane | Austen | 2018-08-07 | 2.5 | | Yes | Jane | Austen | 2018-08-07 | 3.5 | | Yes | Jane | Austen | 2018-08-07 | 3 | | Yes | Jane | Austen | 2018-08-07 | 0.5 | | Yes | Emily | Bronte | 2018-08-06 | 1 | | Yes | Emily | Bronte | 2018-08-06 | 4 | | Yes | Emily | Bronte | 2018-08-06 | 2 | | Yes | Emily | Bronte | 2018-08-07 | 8 | | Yes | Emily | Bronte | 2018-08-07 | 2 | | Yes | Emily | Bronte | 2018-08-11 | 1 |

Using the Standard Regular Working Day Hours

If -h is no included, the overtime report will use the standard regular working day (8 hours per day):

harvest-overtime -i harvest_time_report_from2018-08-06to2018-08-12.csv -o report.csv

CSV report:

| Employee | Weekdays | Weekends | 2018-08-06 | 2018-08-07 | 2018-08-11 | | ------------ | -------- | -------- | ---------- | ---------- | ---------- | | Jane Austen | 2 | 0 | 8.5 | 9.5 | | | Emily Bronte | 1 | 1 | 7 | 10 | 1 |

Changing the Regular Working Day Hours

Add -h in order to change the regular working hours. For instance, if the regular working day has 6 hours:

harvest-overtime -i harvest_time_report_from2018-08-06to2018-08-12.csv -o report.csv -h 6

CSV report:

| Employee | Weekdays | Weekends | 2018-08-06 | 2018-08-07 | 2018-08-11 | | ------------ | -------- | -------- | ---------- | ---------- | ---------- | | Jane Austen | 6 | 0 | 8.5 | 9.5 | | | Emily Bronte | 5 | 1 | 7 | 10 | 1 |

Printing the Report to the Command Line

Add -p in order to print the report. You can also check a detailed report (includes total time per day) in the provided output file.

harvest-overtime -i harvest_time_report_from2018-08-06to2018-08-12.csv -o report.csv -p

Printed report:

harvest-overtime ⏰

Regular day hours: 8
Input file: harvest_time_report_from2018-08-06to2018-08-12.csv
Output file: report.csv

┌──────────────┬──────────┬──────────┐
│ Employee     │ Weekdays │ Weekends │
├──────────────┼──────────┼──────────┤
│ Jane Austen  │ 2        │ 0        │
├──────────────┼──────────┼──────────┤
│ Emily Bronte │ 1        │ 1        │
└──────────────┴──────────┴──────────┘┘

CSV report:

| Employee | Weekdays | Weekends | 2018-08-06 | 2018-08-07 | 2018-08-11 | | ------------ | -------- | -------- | ---------- | ---------- | ---------- | | Jane Austen | 2 | 0 | 8.5 | 9.5 | | | Emily Bronte | 1 | 1 | 7 | 10 | 1 |

🙋 Help and Support

📣 Feedback

If you have any suggestions or want to let me know what you think of this tool, feel free to open an issue.

License

MIT