lta-api-project

1.0.0 • Public • Published

LTA API Project

This project is a command-line interface (CLI) for accessing the Singapore Land Transport Authority (LTA) DataMall APIs. It allows users to fetch bus arrival information, parking availability, nearest bus stops, and estimated travel time between two bus stops.

Installation

  1. Clone the repository or download the project files.

  2. Install the required dependencies using npm:

npm install

Usage

The following commands are available:

  1. Get bus arrival information:
npm run arr
  1. Get parking availability information:
npm run parking
  1. Find the nearest bus stops based on latitude and longitude:
npm run nearest
  1. Estimate the travel time between two bus stops:
npm run traveltime

Configuration

To use the LTA DataMall API, you need an API key. Create a .env file in the root directory of the project and set the LTA_API_KEY environment variable:

LTA_API_KEY=your_api_key_here

Replace your_api_key_here with your actual LTA DataMall API key.

Dependencies

  • axios - Promise-based HTTP client for Node.js
  • dotenv - Loads environment variables from a .env file
  • yargs - A command-line argument parser for Node.js

Package Sidebar

Install

npm i lta-api-project

Weekly Downloads

2

Version

1.0.0

License

ISC

Unpacked Size

48.4 kB

Total Files

12

Last publish

Collaborators

  • minmyatoo