lydiard
Lydiard is a JavaScript library to help you work with time, distance, and combinations of time and distance, called splits. "400 meters in 59 seconds" would be a split. As would "26:22 for ten kilometers."
Lydiard is composed of a handful of data model classes, including Distance
, Split
, and Race
, and a few helper utilities to work with durations*, paces, and strings.
Example Usage
Distance
s
Working with Distance
is the first simple data class. There are a number of ways to create a new Distance
instance:
// Make a Distance instance with the constructorconst oneLap = 400 DISTANCE_UNITMETER // Make a Distance instance with the `fromString` static methodconst aMile = Distance;
Why Lydiard?
Yes, it's named after the late, great New Zealand distance running coach, Arthur Lydiard.