node-GTFS — importar y consultar GTFS en SQLite (Node)
⚠️ Corrección 2026-09-05 (auditoría): la API es
importGtfs+ imports nombrados (getStops,getRoutes,getStopsAsGeoJSON,getShapesAsGeoJSON); nogtfs.importFeed()/gtfs.routes()/gtfs.exportToGeoJSON(). CLIs:gtfs-import,gtfsrealtime-update,gtfs-export.
Repo: https://github.com/BlinkTagInc/node-gtfs (TypeScript, ~500⭐).
When to Use
- Cuando pidas importar y consultar un feed GTFS (SQLite local) desde Node.js.
Uso (API real)
npm install node-gtfs
import { importGtfs, getStops, getRoutes, getStopsAsGeoJSON } from 'gtfs';
await importGtfs({ agencies: [{ agency_key:'mi', url:'http://.../google_transit.zip' }] });
const stops = getStops(); // o getRoutes(), getStopsAsGeoJSON(), getShapesAsGeoJSON()
CLIs: gtfs-import, gtfsrealtime-update, gtfs-export.
Pitfalls
- API:
importGtfs+ imports nombrados (getStops/getRoutes/getStopsAsGeoJSON/getShapesAsGeoJSON). - No
gtfs.importFeed()nigtfs.routes({lat,lng,maxDistance})/exportToGeoJSON. - CLI de import:
gtfs-import(busca la configagenciesconurl/path).
Verificación
importGtfs(config)con un feed, luegogetStops()y comprobar paradas.