easy-fit
Parse your .FIT files easily, directly from JS. Written in ES6.
Install
$ npm install easy-fit --save
How to use
See in examples folder:
// Require the modulevar EasyFit = default; // Read a .FIT filevar fs = ;fs;
API Documentation
new EasyFit(Object options)
Needed to create a new instance. options is optional, and is used to customize the returned object.
Allowed properties :
mode
: Stringcascade
: Returned object is organized as a tree, eg. each lap contains arecords
fields, that is an array of its records (default)list
: Returned object is organized as lists of sessions, laps, records, etc..., without parent-child relationboth
: A mix of the two other modes, eg.records
are available inside the root field as well as inside each laps
lengthUnit
: Stringm
: Lengths are in meters (default)km
: Lengths are in kilometersmi
: Lengths are in miles
temperatureUnit
: Stringcelsius
:Temperatures are in °C (default)kelvin
: Temperatures are in °Kfarhenheit
: Temperatures are in °F
speedUnit
: Stringm/s
: Speeds are in meters per seconds (default)km/h
: Speeds are in kilometers per hourmph
: Speeds are in miles per hour
force
: Booleantrue
: Continues even if they are errors (default for now)false
: Stops if an error occurs
elapsedRecordField
: Booleantrue
: Includes aelapsed_time
field inside eachrecord
field, containing the elapsed time in seconds since the first record (default)false
easyFit.parse(Buffer file, Function callback)
callback receives two arguments, the first as a error String, and the second as Object, result of parsing.
Contributors
Big thanks to Mikael Lofjärd for his early prototype. See CONTRIBUTORS.
License
MIT license; see LICENSE.
(c) 2016 by Pierre Jacquier