Gathering detailed insights and metrics for hk-bus-eta
Gathering detailed insights and metrics for hk-bus-eta
Gathering detailed insights and metrics for hk-bus-eta
Gathering detailed insights and metrics for hk-bus-eta
npm install hk-bus-eta
Typescript
Module System
72.3
Supply Chain
99.4
Quality
87.2
Maintenance
100
Vulnerability
80.9
License
TypeScript (99.64%)
JavaScript (0.36%)
Total Downloads
18,745
Last Day
8
Last Week
128
Last Month
339
Last Year
7,125
32 Stars
92 Commits
12 Forks
1 Watching
3 Branches
3 Contributors
Minified
Minified + Gzipped
Latest Version
3.7.1
Package Id
hk-bus-eta@3.7.1
Unpacked Size
203.37 kB
Size
49.55 kB
File Count
105
Publised On
19 Dec 2024
Cumulative downloads
Total Downloads
Last day
-11.1%
8
Compared to previous day
Last week
109.8%
128
Compared to previous week
Last month
-21.5%
339
Compared to previous month
Last year
47.6%
7,125
Compared to previous year
2
7
Bus ETAs in Hong Kong is now available as open data in Hong Kong, while there is no format normalization across different transport provider. This package is a js package (typescript supported) for querying normalized public traffic ETA (Estimated Time of Arrival) in Hong Kong. The ETA data structure is based on hkbus/hk-bus-crawling and a well-established open-source project is known as hkbus.app.
A Python version package is available here and the source code is available here.
Live demo is available here.
npm install hk-bus-eta
or
yarn add hk-bus-eta
Crawling traffic database:
1import { fetchEtaObj } from "hk-bus-eta"; 2import type { BusDb } from "hk-bus-eta"; 3 4fetchEtaDb().then((db: BusDb) => { 5 console.log(db) 6})
Crawling ETA
1import { fetchEtas } from "hk-bus-eta"; 2import tyep { Eta } from "hk-bus-eta"; 3 4// busDb is the BusDb object fetched by fetchEtaObj 5 6fetchEtas({ 7 ...busDb.routeList["1+1+CHUK YUEN ESTATE+STAR FERRY"], 8 seq: 0, 9 language: "en", 10}).then(etas => { 11 console.log(etas) 12})
The data structure of EtaDb is as follows:
1{ 2 holidays: string[]; 3 routeList: { 4 [routeId: string]: { 5 route: string, 6 co: Company[], 7 orig: { 8 en: string, 9 zh: string 10 }, 11 dest: { 12 en: string, 13 zh: string 14 }, 15 fares: string[] | null, 16 faresHoliday: string[] | null, 17 freq: { 18 [type: string]: { 19 [startTime: string]: [string, string] | null 20 } 21 } | null, 22 jt: string | null, 23 seq: number, 24 serviceType: string, 25 stops: { 26 [company: string]: string[] 27 }, 28 bound: { 29 [company: string]: "O" | "I" | "OI" | "IO" 30 }, 31 gtfsId: string, 32 nlbId: string 33 } 34 } 35 stopList: { 36 [stopId: string]: { 37 location: { 38 lat: number, 39 lng: number, 40 }, 41 name: { 42 en: string, 43 zh: string 44 } 45 } 46 } 47 stopMap: { 48 [stopId: string]: Array<{ 49 [company: string]: string 50 }> 51 } 52}
The data structure of Eta is as follows:
1{ 2 eta: string, 3 remark: { 4 zh: string, 5 en: string 6 }, 7 co: string 8}
Project owner chunlaw is the initiator of the whole project. Everyone is welcome to contribute.
GPL-3.0 license
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
4 existing vulnerabilities detected
Details
Reason
Found 3/24 approved changesets -- score normalized to 1
Reason
2 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 1
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More