Skip to content

Manage orienteering split times data with Javascript/Typescript

License

Notifications You must be signed in to change notification settings

orienteering-js/split-times

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

split-times

Parse and manage orienteering split times data with Javascript/Typescript

Installation

Deno

deno add @orienteering-js/split-times

Npm

npx jsr add @orienteering-js/split-times

Yarn

yarn dlx jsr add @orienteering-js/split-times

Pnpm

pnpm dlx jsr add @orienteering-js/split-times

Bun

bunx jsr add @orienteering-js/split-times

Usage

import { parseIofXmlSplitTimesFile } from "@orienteering-js/split-times";
import { readFileSync } from "node:fs";

const iofXmlSplitTimesFile = readFileSync("file.xml");

const xmlDocument = new DOMParser().parseFromString(
  iofXmlSplitTimesFile,
  "text/xml"
);

const [runners, error] = parseIofXmlSplitTimesFile(
  xmlDocument,
  "H21",
  "+02:00",
  "2024-05-14"
);

if (error !== null) {
  runners.forEach((runner) => {
    console.log(runner.time);
  });
}

About

Manage orienteering split times data with Javascript/Typescript

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published