npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@buildvisionai/construction-calculators

v1.0.2

Published

Pure TypeScript calculation functions for construction estimating — concrete, gravel, roofing, lumber, paint, flooring, and more.

Readme

@buildvisionai/construction-calculators

npm version npm downloads License: MIT TypeScript

Pure TypeScript functions for construction estimating — zero dependencies, no React, no DOM. Works in Node, browser, Deno, and edge runtimes.

Built and maintained by BuildVision — AI-powered construction estimating software. Try the live calculators →


Install

npm install @buildvisionai/construction-calculators
# or
yarn add @buildvisionai/construction-calculators
# or
pnpm add @buildvisionai/construction-calculators

Quick Start

import {
  calculateConcrete,
  calculateMarkup,
  calculateRoofingCost,
} from '@buildvisionai/construction-calculators';

// Concrete volume for a 20×30 ft slab, 4 inches thick
const slab = calculateConcrete({
  shape: 'rectangular',
  length: 20,
  width: 30,
  depth: 4 / 12,
  units: 'imperial',
});
console.log(slab.volumeCuYd);  // 2.22 cubic yards
console.log(slab.bagsNeeded);  // 134 × 60lb bags

// Price it up with markup
const quote = calculateMarkup({ costs: 850, markupPercent: 25 });
console.log(quote.totalWithMarkup);      // $1,062.50
console.log(quote.profitMarginPercent);  // 20%

// Roofing cost range
const roof = calculateRoofingCost({
  roofArea: 2400,
  materialType: 'asphalt',
  regionMultiplier: 1.0,
  pitchMultiplier: 1.1,
  storiesMultiplier: 1.0,
  includeTearOff: true,
  units: 'imperial',
});
console.log(`$${roof.totalLow.toFixed(0)}–$${roof.totalHigh.toFixed(0)}`);

Calculators

Concrete & Masonry

| Function | Description | Live Demo | |----------|-------------|-----------| | calculateConcrete | Rectangular/circular volume, bags, sand, gravel, water | Concrete Calculator | | calculateConcreteSlab | Slab volume, 60/80lb bags, ready-mix trucks, rebar | Concrete Slab Calculator | | calculateConcreteBlock | CMU block count, mortar bags, cost estimate | Concrete Block Calculator | | calculateRetainingWall | Block courses, backfill volume, drainage, geogrid layers | Retaining Wall Calculator |

Materials & Aggregates

| Function | Description | Live Demo | |----------|-------------|-----------| | calculateGravel | Volume, tonnage, 50lb bags, cost | Gravel Calculator | | calculateBoardFoot | Lumber board feet, cubic meters, weight | Board Foot Calculator | | calculateInsulation | R-value thickness, rolls/bags by insulation type, cost | Insulation Calculator | | calculatePavers | Paver count + waste, sand bed, gravel base | Paver Calculator |

Interior Finishes

| Function | Description | Live Demo | |----------|-------------|-----------| | calculateDrywall | Sheets, tape rolls, compound buckets, screws | Drywall Calculator | | calculateFlooring | Planks/boxes, underlayment, transition strips, cost | Flooring Calculator | | calculatePaint | Gallons, primer, cost range, time estimate | Paint Calculator |

Roofing

| Function | Description | Live Demo | |----------|-------------|-----------| | calculateRoofMaterials | Shingle bundles, accessories, bid price, gross margin | Roof Calculator | | calculateRoofingCost | Installed cost by material, region, pitch, stories | Roofing Cost Calculator | | calculateMetalRoofCost | Metal roof cost + 50-year vs asphalt comparison | Metal Roof Cost Calculator | | pitchFromRiseRun | Angle and percent from rise/run | Roof Pitch Calculator | | pitchFromAngle | Rise/run from pitch angle | Roof Pitch Calculator | | pitchFromPercent | Rise/run from slope percent | Roof Pitch Calculator | | calculateRafterLength | Rafter length from pitch and half-span | Roof Pitch Calculator |

Structures & Exterior

| Function | Description | Live Demo | |----------|-------------|-----------| | calculateSquareFootage | Multi-room area for rectangle, square, circle shapes | Square Footage Calculator | | calculateFence | Posts, rails, pickets, panels, concrete bags, cost | Fence Calculator | | calculateStairs | Step count, rise/run, stringer length, angle | Stair Calculator | | calculateDeckCost | Boards, joists, posts, footings, railing, installed cost | Deck Cost Calculator |

Business & Finance

| Function | Description | Live Demo | |----------|-------------|-----------| | calculateMarkup | Selling price and profit margin from cost + markup % | Markup Calculator | | calculateMarkupFromMargin | Required markup % to hit a target profit margin | Markup Calculator | | calculateLaborCost | Total labor cost with payroll burden multiplier | Labor Cost Calculator | | calculateHourlyRate | Billable rate from annual expenses + profit margin | Hourly Rate Calculator | | calculateNetProfit | Projects/month needed to hit annual profit goal | Net Profit Calculator | | calculateConstructionCost | Line-item cost roll-up by category (materials/labor/equipment) | Construction Cost Calculator | | calculateEquipmentDepreciation | 4-method schedule: straight-line, declining balance, SYD, DDB | Equipment Depreciation Calculator | | calculateTimeline | Critical path method (CPM) — earliest/latest start, float | Timeline Calculator |


Units

All functions accept a units parameter — 'imperial' or 'metric'. Outputs include both unit variants where relevant.

// Imperial: feet, inches, lbs, gallons
calculateConcrete({ ..., units: 'imperial' })

// Metric: meters, cm/mm, kg, liters
calculateConcrete({ ..., units: 'metric' })

Design Principles

  • Pure functions — input object in, result object out, no side effects
  • Zero dependencies — nothing to audit, nothing to break
  • TypeScript first — full types on all inputs and outputs
  • Dual ESM + CJS — works in any JS environment

Contributing

PRs welcome. Good areas to expand: HVAC load, electrical, plumbing, sitework, earthworks.


Built by BuildVision — construction estimating software for the modern contractor.