A super simple wrapper for the kinda hidden National Rail station code API. Allows you to search for a station name and brings back an array of matching stations. The station information contains its three letter [CRC code](National Rail Enquiries - Station Codes), full name, latitude, longitude, postcode, local operator code and the raw API response.
npm install national-rail-stations --save
var stations = require('national-rail-stations'),
stationName = 'richmond';
stations.search(stationName, function(error, stations) {
if (!error) {
stations.forEach(function(station){
console.log(station.code, station.name);
});
}
});
- 0.1.0 Initial release