Installation

Install via npm or yarn. Zero dependencies. TypeScript support included.

terminal
# npm npm install lhbusa-valuation-engine # yarn yarn add lhbusa-valuation-engine

Quick Start

Basic usage with the calculateOffer function. Pass property details, get an instant valuation.

example.ts
import { calculateOffer } from 'lhbusa-valuation-engine'; const result = calculateOffer({ arv: 310000, condition: 'fair', sqft: 1850, beds: 3, baths: 2, market: 'stable' }); console.log(result); // { // offer: 247500, // confidence: 0.94, // breakdown: { arv: 310000, repairs: 24800, net: 285200 } // }

API Reference calculateOffer()

The main function for calculating property offers. All parameters are validated at runtime.

ParameterTypeDescription
arv requirednumberAfter Repair Value in dollars
condition required'excellent' | 'good' | 'fair' | 'poor'Current property condition
sqftnumberSquare footage (improves accuracy)
bedsnumberNumber of bedrooms
bathsnumberNumber of bathrooms
market'hot' | 'stable' | 'cold'Current market conditions

Response Object

The function returns a structured object with the calculated offer and supporting data.

types.ts
interface OfferResult { offer: number; // Maximum offer price confidence: number; // 0-1 confidence score breakdown: { arv: number; // Input ARV repairs: number; // Estimated repairs net: number; // Net after repairs }; recommendation: 'strong_buy' | 'buy' | 'hold' | 'pass'; }