Skip to content

gssumesh/melbourne-metro-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

melbourne-metro-sdk

Coverage Status Build Status

A reference implementation for Melbourne Metro SDK v3. It tries to fetch next train information calling Metro SDK based on the API keys provided.

npm run scripts

  • npm run test: Runs jest tests once
  • npm run cover: Runs jest code

Installation

  • npm install melbourne-metro-sdk

Usage

const melbourneMetro = require('melbourne-metro-sdk');
const melbourneMetroConfig = melbourneMetro.init({
		api: {
			BASE_URL: 'sample_base_url',
			APP_KEY: 'sample_app_key',
			APP_USER: 'sample_app_user'
		}
	})

melbourneMetroConfig.nextTrain({
 route_id: 5,
 route_type: 0,
 stop_id: 1155
}).then(data => console.log(data)).catch(e => console.log(e)); 

melbourneMetroConfig.routeDetails({
 route_type: 0
}).then(data => console.log(data)).catch(e => console.log(e)); 

Methods Supported

  • nextTrain({route_id, route_type, stop_id}) => Promise with next Train details

  • routeDetails({route_type}) => Promise with route details including all stops

About

A simple SDK to fetch extTrain in

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published