A simple utility library to access KTM Berhad (Malaysia Train) schedule information. This package is available on npm and provides a few utility functions to retrieve and manipulate train schedules.
Note: This library is created as a utility for creating and testing OpenAI function calling.
- Fetch KTM Berhad (KTMB) train schedules
- Utility functions to search for available trains between stations
- Filter schedules by departure and arrival times
- Lightweight and easy to use
You can install this package via npm:
npm install ktmb-schedule
Below is an example of how to use the ktmb library:
const ktmb = require('ktmb-schedule');
// Example: Get all train schedules
const schedules = ktmb.getTrainSchedules();
console.log(schedules);
// Example: Find trains between two stations
const availableTrains = ktmb.searchTrains('Kuala Lumpur', 'Ipoh', '08:00', '12:00');
console.log(availableTrains);
Coming soon .....
This library is specifically designed to help developers test and build OpenAI function calling mechanisms. The ktmb
functions provide structured data that can be used to simulate and validate API calls.
Contributions are welcome! Please follow these steps to contribute:
- Fork the repository
- Create a new branch (
git checkout -b feature-branch
) - Commit your changes (
git commit -m 'Add new feature'
) - Push to the branch (
git push origin feature-branch
) - Create a Pull Request
This project is licensed under the MIT License. See the LICENSE file for details.