0.1.0 • Published 5 years ago

lydiard v0.1.0

Weekly downloads
4
License
ISC
Repository
github
Last release
5 years ago

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

Working with Distances

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 constructor
const oneLap = new Distance(400, DISTANCE_UNIT.METER)

// Make a Distance instance with the `fromString` static method
const aMile = Distance.fromString('1 mile');

Why Lydiard?

Yes, it's named after the late, great New Zealand distance running coach, Arthur Lydiard.