parse-gym-log

1.0.0 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i parse-gym-log

Weekly Downloads

3

Version

1.0.0

License

ISC

Unpacked Size

36.4 kB

Total Files

9

Last publish

Collaborators

  • rane