Socket
Socket
Sign inDemoInstall

metro-info

Package Overview
Dependencies
8
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    metro-info

Christchurch (Unofficial) MetroInfo API NodeJS library


Version published
Maintainers
1
Install size
9.30 MB
Created

Changelog

Source

v1.1.0

Readme

Source

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.

Keywords

FAQs

Last updated on 31 May 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc