tunnit
calculates number of hours for a text file
Last updated 5 years ago by rane .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install tunnit -g
SYNC missed versions from official npm registry.

tunnit Build Status npm version

calculates number of hours for a text file

npm install -g tunnit

intro

assuming work.txt

22.01.2014 09:30-16:45
23.01.2014 09:30-14:30
24.01.2014 08:30-17:00
$ tunnit < work.txt
22.01.2014 09:30-16:45 7:15
23.01.2014 09:30-14:30 5:00
24.01.2014 08:30-17:00 8:30

customization

you can easily add custom rules and logic

~/.config/tunnit.js

module.exports = {
  // :: adjust(mins: Number, line: String): Number
  adjust: function(mins, line) {
    // you can parse `line` here and adjust `mins` based on that.
    // subtract 30 minutes for each day because i had lunch
    return mins - 30;
  },

  // :: mapOutputLine(line: String): String
  mapOutputLine: function(line) {
    // make changes to line right before it is printed.
    // line contains duration at this point
    return line;
  }
};

see another, more involved example config

Current Tags

  • 1.0.0                                ...           latest (5 years ago)

6 Versions

  • 1.0.0                                ...           5 years ago
  • 0.1.1                                ...           5 years ago
  • 0.1.0                                ...           5 years ago
  • 0.0.3                                ...           5 years ago
  • 0.0.2                                ...           5 years ago
  • 0.0.1                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (6)
Dev Dependencies (3)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |