lydiard

0.1.0 • Public • Published

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.

Package Sidebar

Install

npm i lydiard

Weekly Downloads

5

Version

0.1.0

License

ISC

Unpacked Size

57.1 kB

Total Files

20

Last publish

Collaborators

  • erikphansen