New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

butter-lib

Package Overview
Dependencies
Maintainers
0
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

butter-lib

BuTTER Library は、ストレージ上に細分化した状態で保存されているGTFSを基にした時刻表情報を集め、ブラウザ内で必要な情報に加工するライブラリです。DBを使わずにデータ処理をブラウザ内とする

latest
npmnpm
Version
1.1.0
Version published
Weekly downloads
9
-79.07%
Maintainers
0
Weekly downloads
 
Created
Source

BuTTER Library

BuTTER Library は、ストレージ上に細分化した状態で保存されているGTFSを基にした時刻表情報を集め、ブラウザ内で必要な情報に加工するライブラリです。DBを使わずにデータ処理をブラウザ内とする

関数と利用方法

  • Butter.init() この関数は初期化に使用されます。例えば:
import Butter from './dist.js';
Butter.init()
  • Butter.getHostDataList() この関数はホストのデータリストを取得するために使用されます。例:
const hostData = await Butter.getHostDataList()
console.log(hostData)
  • Butter.getAgencyInfo(gtfs_id) 特定のGTFS IDに関連する機関情報を取得します。例:
const agencyInfo = await Butter.getAgencyInfo("your_gtfs_id")
console.log(agencyInfo)
  • Butter.getBusStops(gtfs_id, version_id) 特定のGTFS IDとバージョンIDに関連するバス停を取得します。例:
const stops = await Butter.getBusStops("your_gtfs_id", "your_version_id")
console.log(stops)
  • Butter.getTrips(gtfs_id, version_id) 特定のGTFS IDとバージョンIDに関連するバスの旅行情報を取得します。例:
const trips = await Butter.getTrips("your_gtfs_id", "your_version_id")
console.log(trips)
  • Butter.getStopsBySubstring(substring) 特定の文字列を含むバス停を取得します。例:
const stops = await Butter.getStopsBySubstring("substring")
console.log(stops)
  • Butter.getStopsWithinRadius(lat, lon, radius) 特定の緯度、経度、半径の範囲内にあるバス停を取得します。例:
const aroundStops = await Butter.getStopsWithinRadius(35.693906, 139.701504, 500)
console.log(aroundStops)
  • Butter.getBusInfo(lat, lon) 特定の緯度、経度に関連するバスの情報を取得します。例:
const busInfo = await Butter.getBusInfo(35.693906, 139.701504)
console.log(busInfo)
  • Butter.fetchTimeTableV1(gtfs_id, options) 特定のGTFS IDとオプションに基づいて時刻表情報を取得します。例:
let tt = await Butter.fetchTimeTableV1("your_gtfs_id", {
    date: "20230513",
    stop_ids: ["your_stop_id"]
})
console.log(tt)
  • Butter.getComsumedOp() これまでに消費されたオペレーションの数を取得します。例:
console.log("COMSUMED OPERATIONS ARE", Butter.getComsumedOp())

注意:上記の例では、"your_gtfs_id", "your_version_id", "substring", "your_stop_id"などは実際の値に置き換える必要があります。

webpackのbuild方法

依存モジュールのインストール

npm install

build

npm run build

Keywords

GTFS

FAQs

Package last updated on 30 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts