vehicle-infos
v0.2.0
Published
TypeScript vehicle information library with brand-model fuel consumption data
Maintainers
Readme
vehicle-infos
A TypeScript vehicle information library with global brand-model coverage and a large built-in catalog.
Scope
The package supports the following vehicle types:
- truck
- van
- semi-truck
- passenger-car
Each record includes:
vehicleTypebrandmodelenginefuelConsumptionLPer100KmbodyType?— body/cargo type (see below)cargoVolumeCubicMeters?— internal cargo volume in m³ (vans)payloadCapacityKg?— max payload capacity in kg (commercial vehicles)grossVehicleWeightKg?— gross vehicle weight (GVW) in kg (commercial vehicles)sourceUrlsourceNoteupdatedAt
Body Types
The bodyType field uses one of the following values exported as BODY_TYPES:
Passenger cars: sedan, hatchback, station-wagon, coupe, convertible, suv, mpv, pickup
Light commercial: panel-van, minibus, minivan, luton
Trucks / semi-trucks: box-body, curtainsider, flatbed, refrigerated, tipper, tanker, container-carrier, car-transporter, livestock, logging, skip-loader, lowboy, bulk-carrier, rail-carrier, chassis-cab, crew-cab
Installation
npm install vehicle-infosUsage
import { listByVehicleType, listVehicles, getVehicle, BODY_TYPES } from "vehicle-infos";
// List all semi-trucks
const semiTrucks = listByVehicleType("semi-truck");
// Filter by body type
const curtainsiders = listVehicles({ bodyType: "curtainsider" });
const tippers = listVehicles({ vehicleType: "truck", bodyType: "tipper" });
// Get a specific vehicle
const volvoFH = getVehicle({
vehicleType: "semi-truck",
brand: "Volvo",
model: "FH"
});
// → { bodyType: "curtainsider", grossVehicleWeightKg: ..., payloadCapacityKg: ..., ... }
// Access the full BODY_TYPES list
console.log(BODY_TYPES);API
listVehicles(options?)
vehicleType?:"truck" | "van" | "semi-truck" | "passenger-car"brand?: stringmodel?: stringbodyType?: one of theBodyTypevaluescaseSensitive?: boolean, defaultfalse
listByVehicleType(vehicleType)
Lists all records for the selected type.
getVehicle(options)
Returns a single record by type + brand + model. Returns null when no match exists.
hasVehicle(options)
Returns whether a type + brand + model combination exists.
Types
import type { VehicleInfo, VehicleType, BodyType } from "vehicle-infos";
import { VEHICLE_TYPES, BODY_TYPES } from "vehicle-infos";Development
npm install
npm run verifyverify runs:
- lint
- typecheck
- test
- build
Data Policy
- Records without a source are excluded from the dataset.
sourceUrlandsourceNoteare mandatory for every record.- Fuel consumption is normalized to
L/100km. bodyType,cargoVolumeCubicMeters,payloadCapacityKg,grossVehicleWeightKgare optional — populated where reliable data is available.- The catalog is generated from brand family seeds to keep 500+ records maintainable.
