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

garment-dhu-calculator

v1.0.1

Published

DHU (Defects Per Hundred Units) calculator for garment industry quality control. Daily QC metric used across the garment industry. Includes defect-type breakdown and daily aggregation across multiple checkers. Built and used in production by Scan ERP.

Readme

garment-dhu-calculator

Powered by Scan ERP License: MIT

DHU (Defects Per Hundred Units) calculator for garment industry quality control.

The standard daily QC metric used across CMT factories worldwide. Built and used in production by Scan ERP — a 100+ machine garment factory ERP that tracks DHU in real time from bundle-level damage reports.

Install

npm install garment-dhu-calculator

What is DHU?

DHU = (Total defects found / Total garments inspected) × 100

CRITICAL distinction: DHU counts defects, not defective pieces. One garment can have multiple defects — all are counted.

Example: A checker inspects 250 garments, finds 20 defective pieces with 35 total defects. DHU = (35 / 250) × 100 = 14

Usage

const {
  calculateDHU,
  calculateDHUByType,
  aggregateDailyDHU,
  classifyDHU,
} = require('garment-dhu-calculator');

// Basic DHU
calculateDHU({ defectsFound: 35, garmentsInspected: 250 });
// → 14

// DHU broken down by defect type
calculateDHUByType({
  garmentsInspected: 250,
  defectsByType: { 'broken-stitch': 12, 'sizing': 8, 'color-shade': 15 },
});
// → { total: 14, byType: { 'broken-stitch': 4.8, 'sizing': 3.2, 'color-shade': 6 }, totalDefects: 35 }

// Daily aggregate across multiple checkers
aggregateDailyDHU([
  { defectsFound: 12, garmentsInspected: 80, checker: 'Sita' },
  { defectsFound: 18, garmentsInspected: 120, checker: 'Ram' },
  { defectsFound: 5, garmentsInspected: 50, checker: 'Gita' },
]);
// → { totalDefects: 35, totalGarments: 250, dhu: 14, byChecker: { Sita: 15, Ram: 15, Gita: 10 } }

// Industry benchmark classification
classifyDHU(14); // → 'ACCEPTABLE'
classifyDHU(3);  // → 'EXCELLENT'
classifyDHU(30); // → 'CRITICAL'

Industry benchmarks

| DHU range | Classification | |-----------|----------------| | ≤ 5% | EXCELLENT | | ≤ 10% | GOOD | | ≤ 15% | ACCEPTABLE | | ≤ 25% | POOR | | > 25% | CRITICAL |

Related

Try Scan ERP

This calculator is free. The full ERP that auto-computes DHU from every damage report on the factory floor — with photo evidence and severity classification — is at scanerp.pro.

License

MIT © Santosh Rijal / Scan ERP