gtfs-bods
Version:
A CLI tool for processing UK Bus Open Data Service (BODS) GTFS data - import, export, and query transit data with ease
29 lines • 1.12 kB
JavaScript
import { readFile } from 'fs/promises';
import path from 'node:path';
async function testConfig() {
try {
console.log('Testing configuration loading...');
// Test absolute path
const configPath = path.resolve('./src/config.json');
console.log('Config path:', configPath);
const configData = await readFile(configPath, 'utf8');
const config = JSON.parse(configData);
console.log('✅ Configuration loaded successfully:');
console.log(JSON.stringify(config, null, 2));
// Check if GTFS file exists
const gtfsPath = path.resolve(config.agencies[0].path);
console.log('GTFS file path:', gtfsPath);
try {
const stats = await import('fs/promises').then(fs => fs.stat(gtfsPath));
console.log(`✅ GTFS file found - Size: ${Math.round(stats.size / 1024 / 1024)} MB`);
}
catch (error) {
console.log('❌ GTFS file not found:', error.message);
}
}
catch (error) {
console.error('❌ Error:', error);
}
}
testConfig();
//# sourceMappingURL=test.js.map