A node app for providing live-status of trains along with other information after fetching details from the Indian Railways API. This is solution for the Git-Heat Week-1 challenge. This node app accepts a 5-digit train number as a command line argument.
- Provided live status of the train
- Provided other info like - name,schedule,running days of train
- Stores the result in a .json file for future reference
Cloning and installing dependencies
git clone https://github.com/AK-007/train-query
cd train-query
npm install
Now for getting the command's details for this app
node app.js --help
Or you can refer to this example for train query
node app.js -t=12854
- yargs - Used this as a command-line tool for parsing arguments
- axios - Used this HTTP client which has built-in promises
- fs - File system module for reading and writing into files
- console-table - for well-formatted output
The fileHandler.js is used for reading and writing .json files.
P.S. There are still some trains that exists but the API says otherwise.