bangkok-train-fare
v1.0.0
Published
TypeScript utilities for Bangkok train station lookup, route building, and fare estimation.
Maintainers
Readme
bangkok-train-fare
TypeScript utilities for Bangkok train station lookup, route building, and fare estimation.
This package is experimental. Fare rules and network data are manually maintained and may lag official updates.
Usage
npm install bangkok-train-fareimport { calculateFare, searchStation } from "bangkok-train-fare";
const result = calculateFare("BL01", "BL02");
console.log(result.fare);
const stations = await searchStation("Siam");
console.log(stations);API
calculateFare(origin, destination)buildPath(origin, destination)calculateGreenFare(stations)searchStation(keyword)searchByCode(code)
Publishing
The repository includes GitHub Actions workflows for CI, snapshot packages, and stable releases.
Snapshots are published with the snapshot npm dist-tag by manually running the Publish workflow:
npm install bangkok-train-fare@snapshotSnapshot versions include the source commit, for example 0.1.0-snapshot.289d6fb.
Stable releases are published by updating package.json version, committing it, and pushing a matching tag:
npm version patch
git push origin main --tagsPublishing uses npm trusted publishing through GitHub Actions OIDC. Configure the package on npm with:
- Owner:
kratuwu - Repository:
bangkok-train-fare - Workflow filename:
publish.yml - Environment:
npm
