@jackgreen2018/vehicle-inspection-report
v1.0.0
Published
A high-performance Rust/WASM library for generating vehicle inspection reports. Fast, client-side, no server required.
Readme
@jackgreen2018/vehicle-inspection-report
A high-performance Rust/WASM library for generating vehicle inspection reports. Fast, client-side, no server required.
Generate professional one-page vehicle inspection reports for auto detailers, used car dealers, and independent mechanics. Perfect for documenting vehicle condition before and after service, or for pre-purchase inspections.
Install
npm install @jackgreen2018/vehicle-inspection-reportUsage
import vehicleInspectionReport from '@jackgreen2018/vehicle-inspection-report';
const pdfBytes = await vehicleInspectionReport.generateInspectionReport({
vin: "1HGBH41JXMN109186",
make: "Toyota",
model: "Camry",
year: 2020,
mileage: 45000,
plate: "ABC123",
color: "Silver",
inspect_date: "2024-08-10",
inspector_name: "John Smith",
company: "Quick Auto Inspection",
inspect_type: "Pre-Purchase Inspection",
owner_name: "Jane Doe",
body_condition: "Good",
paint_condition: "Fair",
tire_condition: "Excellent",
upholstery_condition: "Good",
dashboard_condition: "Excellent",
engine_condition: "Good",
brakes_condition: "Fair",
fluids_condition: "Good",
exterior_notes: "Minor scratch on front bumper.",
interior_notes: "Clean interior.",
mechanical_notes: "All systems operational."
});
// pdfBytes is a Uint8Array containing the PDF
const blob = new Blob([pdfBytes], { type: 'application/pdf' });
const url = URL.createObjectURL(blob);
window.open(url);Node.js (save to file)
import { writeFile } from 'fs/promises';
import vehicleInspectionReport from '@jackgreen2018/vehicle-inspection-report';
const pdfBytes = await vehicleInspectionReport.generateInspectionReport({
vin: "1HGCM82633A123456",
make: "Honda",
model: "Accord",
year: 2021,
mileage: 28000
});
await writeFile('inspection-report.pdf', Buffer.from(pdfBytes));API
generateInspectionReport(options)
Returns a Promise<Uint8Array> containing the PDF bytes.
Options:
| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| vin | string | yes | — | Vehicle Identification Number (17 chars) |
| make | string | yes | — | Vehicle make (e.g., Toyota) |
| model | string | yes | — | Vehicle model (e.g., Camry) |
| year | number | yes | — | Manufacturing year |
| mileage | number | no | 0 | Current mileage |
| plate | string | no | "" | License plate number |
| color | string | no | "" | Vehicle color |
| inspect_date | string | no | "" | Inspection date (YYYY-MM-DD) |
| inspector_name | string | no | "" | Inspector name |
| company | string | no | "" | Inspection company name |
| inspect_type | string | no | "Pre-Purchase Inspection" | Type of inspection |
| owner_name | string | no | "" | Vehicle owner name |
| body_condition | string | no | "" | Body condition |
| paint_condition | string | no | "" | Paint condition |
| tire_condition | string | no | "" | Tire condition |
| upholstery_condition | string | no | "" | Upholstery condition |
| dashboard_condition | string | no | "" | Dashboard & electronics condition |
| engine_condition | string | no | "" | Engine condition |
| brakes_condition | string | no | "" | Brakes condition |
| fluids_condition | string | no | "" | Fluid levels condition |
| exterior_notes | string | no | "" | Exterior damage notes |
| interior_notes | string | no | "" | Interior damage notes |
| mechanical_notes | string | no | "" | Mechanical notes |
Performance
Benchmark results comparing @jackgreen2018/vehicle-inspection-report (Rust/WASM) vs pdf-lib (JavaScript):
=== Vehicle Inspection Report Benchmark ===
Options: VIN=1HGBH41JXMN109186, Toyota Camry (2020), 45000 mi
Iterations: 100
--- Results ---
Library | Time (ms) | Size (bytes) | Pages
-------------------------------------|-----------|--------------|------
@jackgreen2018/vehicle-inspection | 19.9 | 3369 | 1
pdf-lib | 124.2 | 915 | 1
--- Summary ---
WASM speedup: 6.24x faster
WASM size: 368.2% of pdf-lib sizeBenchmarks run via node benchmark.mjs. All measurements are real, not estimated.
Build
npm install
npm run build
npm testLicense
MIT
