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

construction-utils

v1.0.0

Published

Construction calculation utilities for building projects — measurements, materials, lumber, drywall, paint, roofing, slope, and cost estimation helpers.

Downloads

22

Readme

construction-utils

Construction calculation utilities for building projects — measurements, materials, lumber, drywall, paint, roofing, slope, and cost estimation helpers.

Part of the www.slabcalc.co ecosystem. For concrete-specific calculations, see the concrete-calculator package or the online Concrete Slab Calculator.

Install

npm install construction-utils

Quick Start

import { squareFootage, drywallSheets, paintGallons, addMarkup } from "construction-utils";

const area = squareFootage(20, 15);       // 300 sq ft
const sheets = drywallSheets(area);        // 11 sheets (10% waste)
const gallons = paintGallons(area, 2);     // 2 gallons (2 coats)
const price = addMarkup(sheets * 12, 15);  // $151.80 (15% markup)

API Reference

Measurements

| Function | Description | |---|---| | squareFootage(length, width) | Area in sq ft | | perimeter(length, width) | Perimeter in linear ft | | circleArea(diameter) | Area of a circle | | triangleArea(base, height) | Area of a triangle | | roofArea(length, width, pitchRise?) | Roof area adjusted for pitch |

Construction Math

| Function | Description | |---|---| | gradePercent(rise, run) | Slope as percentage | | roofPitch(rise, run?) | Pitch string (e.g., "6:12") | | angleFromSlope(percent) | Degrees from slope % | | slopeFromAngle(degrees) | Slope % from degrees | | hypotenuse(rise, run) | Rafter/stringer length |

Lumber

| Function | Description | |---|---| | boardFeet(thickness, width, length) | Board feet for pricing | | studsNeeded(wallLength, spacing?) | Stud count (default 16″ OC) | | plateLength(wallLength, double?) | Linear ft of plates |

Drywall

| Function | Description | |---|---| | drywallSheets(sqft, waste?) | 4×8 sheets needed (default 10% waste) | | jointCompound(sqft) | Gallons of mud | | drywallTape(sqft) | Feet of tape |

Paint

| Function | Description | |---|---| | paintGallons(sqft, coats?, coverage?) | Gallons needed (default 400 sqft/gal) | | primerGallons(sqft, coverage?) | Primer gallons (default 300 sqft/gal) |

Flooring

| Function | Description | |---|---| | flooringSqft(length, width, waste?) | Material sq ft with waste factor | | tileBoxes(sqft, sqftPerBox?) | Number of tile boxes |

Insulation

| Function | Description | |---|---| | insulationBatts(sqft, sqftPerBundle?) | Batt bundles needed |

Unit Conversions

| Function | Description | |---|---| | feetToMeters(ft) / metersToFeet(m) | Length conversion | | inchesToCm(in) / cmToInches(cm) | Length conversion | | sqftToSqm(sqft) / sqmToSqft(sqm) | Area conversion | | psfToKpa(psf) / kpaToPsf(kpa) | Pressure conversion |

Pricing Helpers

| Function | Description | |---|---| | addMarkup(cost, percent) | Apply markup | | tax(subtotal, percent) | Tax amount | | totalWithTax(subtotal, percent) | Subtotal + tax | | unitCost(total, qty) | Per-unit cost | | bulkDiscount(qty, tiers, unitPrice) | Tiered bulk pricing |

Namespace Imports

Group functions by category:

import { measurements, lumber, drywall, paint, pricing } from "construction-utils";

const area = measurements.squareFootage(20, 15);
const bf = lumber.boardFeet(2, 6, 8);          // 8 board feet
const sheets = drywall.drywallSheets(area);
const gallons = paint.paintGallons(area, 2);
const total = pricing.totalWithTax(500, 8.25);  // $541.25

Common Projects

| Project | Functions to use | |---|---| | Frame a wall | studsNeeded(), plateLength(), boardFeet() | | Hang drywall | drywallSheets(), jointCompound(), drywallTape() | | Paint a room | squareFootage(), paintGallons(), primerGallons() | | Install flooring | flooringSqft(), tileBoxes() | | Estimate roof | roofArea(), roofPitch(), hypotenuse() | | Grade a driveway | gradePercent(), angleFromSlope() | | Bid a job | addMarkup(), totalWithTax(), bulkDiscount() |

For concrete work — slabs, footings, cylinders, stairs — use the Concrete Slab Calculator or the concrete-calculator npm package.

TypeScript

Full type declarations included — zero config needed.

import { boardFeet, type BulkDiscountResult } from "construction-utils";

Related

License

MIT — SlabCalc.co