npm package @come25136/gtfs example

node v12.22.12
version: master
endpointsharetweet
const { GTFS } = require('@come25136/gtfs') const superagent = require('superagent') const moment = require('moment') superagent('http://www3.unobus.co.jp/opendata/GTFS-JP.zip') .responseType('blob') .then(({ body }) => GTFS.importZipBuffer(body)) .then(gtfs => { // agency.txtの中身 console.log(gtfs.agencies); // https://developers.google.com/transit/gtfs/reference/gtfs-extensions?hl=ja#google-translations // translations.txtを検索する関数 console.log(gtfs.findTranslation('岡山駅')) // 時刻表を取得する関数 console.log(gtfs.findRoutes({ routeId: '1642', standardDate: moment() })) })
Loading…

no comments

    sign in to comment