Socket
Socket
Sign inDemoInstall

md-time-track

Package Overview
Dependencies
35
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    md-time-track

Calculate key metrics and create detailed reports from specially formated markdown input containing time tracking data.


Version published
Weekly downloads
1
Maintainers
1
Created
Weekly downloads
 

Readme

Source

md-time-track

Typescript-based node module for parsing markdown based time tracking information. The core module of the md-time-track project.

Description

Uses specially formated markdown files as input to calculate worktime and detailed reports.

Usage

import { parse } from 'md-time-track';

var input = `
### 02.03.2021
- Did something for Project A [9:00 - 11:00, #projectA]
- Did something for Project B [ - 12:00, #projectB]
- Break [ - 13:00, #break]
- Check mails [ - 14:00, #general/mails]

### 03.03.2021
- Did more for Project A [6:00 - 8:00, #projectA]
- Did something for Project C [ - 12:00, #projectC]
- Break [ - 13:00, #break]
- Call [ - 15:00, #general/call]
`
let { days, parse_errors } = parse(input);

console.log(days)

will yield

    [
      {
        "logItems": [
          {
            "startDate": "2021-03-02T08:00:00.000Z",
            "endDate": "2021-03-02T10:00:00.000Z",
            "tags": [
              "#projectA"
            ],
            "lineNumber": 5
          },
          {
            "startDate": "2021-03-02T10:00:00.000Z",
            "endDate": "2021-03-02T11:00:00.000Z",
            "tags": [
              "#projectB"
            ],
            "lineNumber": 6
          },
          {
            "startDate": "2021-03-02T11:00:00.000Z",
            "endDate": "2021-03-02T12:00:00.000Z",
            "tags": [
              "#break"
            ],
            "lineNumber": 7
          },
          {
            "startDate": "2021-03-02T12:00:00.000Z",
            "endDate": "2021-03-02T13:00:00.000Z",
            "tags": [
              "#general/mails"
            ],
            "lineNumber": 8
          }
        ],
        "date": "2021-03-01T23:00:00.000Z",
        "lineNumber": 4
      },
      {
        "logItems": [
          {
            "startDate": "2021-03-03T05:00:00.000Z",
            "endDate": "2021-03-03T07:00:00.000Z",
            "tags": [
              "#projectA"
            ],
            "lineNumber": 11
          },
          {
            "startDate": "2021-03-03T07:00:00.000Z",
            "endDate": "2021-03-03T11:00:00.000Z",
            "tags": [
              "#projectC"
            ],
            "lineNumber": 12
          },
          {
            "startDate": "2021-03-03T11:00:00.000Z",
            "endDate": "2021-03-03T12:00:00.000Z",
            "tags": [
              "#break"
            ],
            "lineNumber": 13
          },
          {
            "startDate": "2021-03-03T12:00:00.000Z",
            "endDate": "2021-03-03T14:00:00.000Z",
            "tags": [
              "#general/call"
            ],
            "lineNumber": 14
          }
        ],
        "date": "2021-03-02T23:00:00.000Z",
        "lineNumber": 10
      }
    ]

Keywords

FAQs

Last updated on 27 Sep 2021

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc