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-cmt-cost

v1.0.1

Published

CMT (Cut, Make, Trim) cost calculator for garment factories. Calculate per-garment making cost from SAM, CPM and line efficiency; compare CMT cost across countries (Bangladesh, India, Vietnam, Cambodia, USA, etc.). Built and used in production by Scan ERP

Downloads

274

Readme

garment-cmt-cost

Powered by Scan ERP License: MIT

CMT (Cut, Make, Trim) cost calculator for garment factories.

Calculates per-garment making cost from SAM × CPM × efficiency, supports trims and packaging, and compares CMT cost across major sourcing countries. Built and used in production by Scan ERP — the garment manufacturing ERP for CMT factories worldwide.

Install

npm install garment-cmt-cost

Formula

Making cost = (SAM × CPM) / Efficiency
CMT cost    = Making cost + Trims + Packaging

Where:

  • SAM = Standard Allowed Minutes per garment
  • CPM = Cost Per Minute of the factory (USD)
  • Efficiency = decimal (0–1), e.g. 0.50 for 50%
  • Trims = thread + labels + buttons + zip per garment
  • Packaging = polybag + hangtag + carton allocation per garment

Example: SAM 15, CPM $0.10 (Bangladesh), 50% efficiency, $0.30 trims, $0.20 packaging → Making = (15 × 0.10) / 0.5 = $3.00; CMT = $3.50

Usage

const {
  calculateCMTCost,
  calculateCPM,
  calculateMakingCost,
  estimateCMTByCountry,
  compareByCountry,
  addMargin,
  COUNTRY_CPM_DEFAULTS,
} = require('garment-cmt-cost');

calculateCMTCost({ sam: 15, cpm: 0.10, efficiency: 0.5, trims: 0.30, packaging: 0.20 });
// → { makingCost: 3.0, cmtCost: 3.5, perDozenCmt: 42, perHundredCmt: 350 }

// Compute CPM from your factory's monthly cost
calculateCPM({ monthlyCost: 250000, workers: 200, hoursPerDay: 8, workingDays: 26 });
// → 0.1002 ($/min)

// Compare cost across countries
compareByCountry({
  sam: 15, efficiency: 0.5, trims: 0.3, packaging: 0.2,
  countries: ['bangladesh', 'india', 'vietnam', 'usa'],
});
// → Bangladesh $3.50 | India $5.90 | Vietnam $5.30 | USA $30.50

// Add a factory margin
addMargin(3.50, 15); // → { finalPrice: 4.025, margin: 0.525 }

Country CPM defaults (approx. USD/min)

| Country | CPM | Country | CPM | |-------------|---------|-------------|---------| | Ethiopia | $0.07 | Sri Lanka | $0.20 | | Myanmar | $0.08 | China | $0.25 | | Nepal | $0.09 | Turkey | $0.30 | | Bangladesh | $0.10 | Mexico | $0.40 | | Pakistan | $0.11 | USA | $1.00 | | Cambodia | $0.12 | | | | Vietnam | $0.16 | | | | India | $0.18 | | |

These are industry averages — use calculateCPM with your own salary + overhead data for accurate costing.

Related

Try Scan ERP

This calculator is free. The full ERP that uses it daily for CMT quote generation — with live SMV data from your own factory floor — is at scanerp.pro.

License

MIT © Santosh Rijal / Scan ERP