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 🙏

© 2025 – Pkg Stats / Ryan Hefner

fabric-weight-converter

v1.0.3

Published

Official F&B Fashion Utility: A battle-tested tool for precise fabric weight (GSM <-> oz/yd²) conversion. Actively used on our e-commerce site (https://sportswearbridge.com/) and maintained by our team.

Downloads

414

Readme

Fabric Weight Converter

Official F&B Fashion Fabric Weight Tool

A lightweight, zero-dependency utility for precise fabric weight conversion between GSM (Grams per Square Meter) and oz/yd² (Ounces per Square Yard).

🛡️ Battle-Tested

This tool was developed by the F&B Fashion team and is actively used on our independent e-commerce site and internal supply chain systems, ensuring absolute data accuracy and reliability.

🚀 Features

  • Extremely Lightweight & Zero Dependency: Fast installation, no bloat.
  • Universal Compatibility: Supports both ESM (import) and CJS (require) modules.
  • Type Safe: Written in TypeScript with complete type definitions.
  • Adjustable Precision: Support for custom decimal places to meet different business needs.

📦 Installation

npm install fabric-weight-converter

💻 Usage

Import

// ESM
import { gsmToOz, ozToGsm } from 'fabric-weight-converter';

// CommonJS
const { gsmToOz, ozToGsm } = require('fabric-weight-converter');

Examples

Convert GSM to oz/yd²

import { gsmToOz } from 'fabric-weight-converter';

// Standard conversion (default precision: 2)
console.log(gsmToOz(300)); // 8.85

// Custom precision
console.log(gsmToOz(300, 4)); // 8.8481

Convert oz/yd² to GSM

import { ozToGsm } from 'fabric-weight-converter';

// Standard conversion (default precision: 1)
console.log(ozToGsm(8.85)); // 300.1

// Custom precision
console.log(ozToGsm(8.85, 0)); // 300

Aliases

For the convenience of non-native English speakers and for faster typing, aliases for common Chinese units are provided:

  • kToZ (克 -> 盅) is an alias for gsmToOz
  • zToK (盅 -> 克) is an alias for ozToGsm
import { kToZ, zToK } from 'fabric-weight-converter';

console.log(kToZ(300)); // 8.85

📚 API Reference

gsmToOz(gsm: number, precision?: number): number

Converts Grams per Square Meter to Ounces per Square Yard.

  • gsm: Weight value (g/m²)
  • precision: Decimal places to round to (default: 2)

ozToGsm(oz: number, precision?: number): number

Converts Ounces per Square Yard to Grams per Square Meter.

  • oz: Weight value (oz/yd²)
  • precision: Decimal places to round to (default: 1)

🏭 About F&B Fashion (Your Professional Sportswear Manufacturer)

This tool is provided to you by the F&B Fashion team.

We are a manufacturer focused on high-quality Sportswear production and export, providing global OEM/ODM (Original Equipment/Design Manufacturer) services. As frontline supply chain workers, we understand the importance of precise data in fabric sourcing and quality control, which is why we developed and open-sourced this tool.

Looking for a reliable sportswear manufacturing partner?
Welcome to visit our official website to learn about our products and cooperation process:

👉 F&B Fashion Official Website: https://sportswearbridge.com/

📄 License

MIT