1.1.0 • Published 11 months ago

metro-info v1.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
11 months ago

metro-info

build codecov npm

🚌 Simplified interaction with Christchurch's Metro Info bus service

Install

npm install metro-info

Usage

Getting times for a specific Platform can be achieved as per the example below.

import { getPlatformTimes, PlatformTimes } from "metro-info";

async function getTimes(): void {
  const platformTimes: PlatformTimes = await getPlatformTimes(1205);
}

If you're unsure of a Platform number, they can be found on the physical stops themselves or alternatively a complete collection of all Platforms with their locations, tags, and various other information can be obtained as per the example below.

import { getPlatformLocations, PlatformLocations } from "metro-info";

async function getLocations(): void {
  const platformLocations: PlatformLocations = await getPlatformLocations();
}

Compatibility

metro-info will opt to use a globally provided fetch method if one exists, before falling back to using node-fetch. This allows compatibility with with any frameworks that implement fetch, such as: NativeScript, React Native, and most browsers.

Models

The models closely resemble those as exposed by the Connexionz API. The schema documentation was incredibly verbose, I have omitted commenting many items as a lot of the schema documentation simply reiterated the property name.

Issues

If you encounter a case where an exception is thrown while parsing the XML response, please raise an issue including the XML that caused the failure and I will investigate the cause.

1.1.0

11 months ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

4 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago