New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

hk-mtr-util

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hk-mtr-util

A simple TypeScript Library contains information about HK MTR.

  • 1.0.2
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

HK MTR Util

A simple TypeScript Library contains information about HK MTR.

Installation

$ npm install hk-mtr-util
or
$ yarn add hk-mtr-util

Usage

Translation

import { MTRUtil } from 'hk-mtr-util';

const stations = MTRUtil.getKowloonLocation();
// [KOWLOON, MONG_KOK, LAI_CHI_KOK, ...]

const translatedStations = stations.map(MTRUtil.translate);
// ["九龍", "旺角", "荔枝角", ...]

By Area

import { MTRUtil } from 'hk-mtr-util';

// Kowloon
const stations = MTRUtil.getKowloonLocation();

// Island
const stations = MTRUtil.getIslandLocation();

// New Territories
const stations = MTRUtil.getNewTerritoriesLocation();

By Line

import { MTRUtil } from 'hk-mtr-util';

// Kwun Tong Line
const stations = MTRUtil.getKwunTongLine();

// Island Line
const stations = MTRUtil.getIslandLine();

// Disneyland Resort Line
const stations = MTRUtil.getDisneylandResortLine();

// etc...

Use Enum

import { IslandLine, SouthIslandLine } from 'hk-mtr-util';

const oceanPark = SouthIslandLine.OCEAN_PARK;

const central = IslandLine.CENTRAL;

Type Definition

import { MTRUtil } from 'hk-mtr-util';
import type { District, AirportExpressLine, IslandLine } from 'hk-mtr-util';

const allStations: District[] = MTRUtil.getAllLocation();

const airportStations: AirportExpressLine[] = MTRUtil.getAirportExpressLine();

const islandStations: IslandLine[] = MTRUtil.getIslandLine();

Keywords

FAQs

Package last updated on 20 May 2021

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc