1.0.0 • Published 6 years ago

parse-gym-log v1.0.0

Weekly downloads
2
License
ISC
Repository
github
Last release
6 years ago

parse-gym-log

Parse text-based workout log file

example

input

20.04.2018
==========

# squat

5 x 100kg
5 x 100kg

# overhead press

5 x 50kg
5 x 50kg
5 x 50kg

# bench press

3 x 5 x 100kg

output

[ { date: '20.04.2018',
    exercises:
     [ { exercise: 'squat',
         sets:
          [ { reps: 5, weight: 100 },
            { reps: 5, weight: 100 } ] },
       { exercise: 'overhead press',
         sets:
          [ { reps: 5, weight: 50 },
            { reps: 5, weight: 50 },
            { reps: 5, weight: 50 } ] },
       { exercise: 'bench press',
         sets:
          [ { reps: 5, weight: 100 },
            { reps: 5, weight: 100 },
            { reps: 5, weight: 100 } ] } ] } ]

usage

const parse = require('parse-gym-log')
parse(input)

cli

Using parse-gym-log on the command-line will output the log in JSON format.

$ npm install -g parse-gym-log
$ < log.txt | parse-gym-log