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

@sctg/aga8-js

v1.0.9

Published

WebAssembly bindings for AGA8 gas properties calculation

Readme

AGA8 GERG-2008, GROSS and DETAIL Gas Properties Calculator

npm version Build Status License Documentation

High-performance WebAssembly implementation of the GERG-2008 equation of state and AGA8 methods for natural gas properties calculations. This package provides JavaScript/TypeScript bindings to the industry-standard algorithms for precise gas property calculations.

Star the project

If you appreciate my work, please consider giving it a star! 🤩

🌟 Features

  • Three Calculation Methods:

    • 📊 GERG-2008 (Reference equations for high-accuracy calculations)
    • 🔍 Detail (AGA8 Part 1 method for precise gas mixtures)
    • 📈 Gross (AGA8 Part 2 method for simplified calculations)
  • Complete Gas Support:

    • 🧪 Full support for all 21 gas components defined by AGA8
    • 🎯 High-precision calculations for natural gas mixtures
    • 🌡️ Wide range of temperature and pressure conditions
  • Technical Excellence:

    • ⚡ WebAssembly-powered for near-native performance
    • 📦 Tree-shakeable npm package
    • 💪 TypeScript type definitions included
    • 📚 Comprehensive API documentation

🚀 Live AGA8 Demo

Try it now at Lasersmart AGA8!

View the demo source code in our Vue.js implementation.

🚀 Live sonic nozzle Demo

Try it now at Lasersmart Sonic Nozzle!

📦 Installation

npm install @sctg/aga8-js

💻 Quick Start

import { AGA8wasm, type GasMixture } from '@sctg/aga8-js';

// Initialize AGA8 module
const AGA8 = await AGA8wasm();
AGA8.SetupGERG();

// Define gas mixture (94% methane, 5% CO2, 1% helium)
const mixture: GasMixture = {
    methane: 0.94,
    nitrogen: 0,
    carbon_dioxide: 0.05,
    ethane: 0,
    propane: 0,
    isobutane: 0,
    n_butane: 0,
    isopentane: 0,
    n_pentane: 0,
    n_hexane: 0,
    n_heptane: 0,
    n_octane: 0,
    n_nonane: 0,
    n_decane: 0,
    hydrogen: 0,
    oxygen: 0,
    carbon_monoxide: 0,
    water: 0,
    hydrogen_sulfide: 0,
    helium: 0.01,
    argon: 0
}

// Calculate properties
const molarMass = AGA8.MolarMassGERG(mixture);
const { D: density } = AGA8.DensityGERG(0, 400, 50000, mixture);
const properties = AGA8.PropertiesGERG(400, density, mixture);

console.log('Results:', {
  molarMass: `${molarMass.toFixed(4)} g/mol`,
  density: `${density.toFixed(4)} mol/L`,
  compressibility: properties.Z.toFixed(6),
  soundSpeed: `${properties.W.toFixed(2)} m/s`
});

Samples

📚 Documentation

🛠️ Development

Prerequisites

  • Node.js ≥ 22.0.0
  • Emscripten SDK ≥ 4.0.0
  • CMake ≥ 3.10

Building from Source

# Emscripten SDK installation
# Clone repository
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
# Download and install the 4.0.1 SDK
./emsdk install 4.0.1
./emsdk activate 4.0.1
source ./emsdk_env.sh
# WebAssembly module build
# Clone repository
git clone https://github.com/sctg-development/aga8-js.git
cd aga8-js

# Install dependencies
npm install

# Build WebAssembly module
npm run build

# Run tests
npm test

🤝 Contributing

We welcome contributions!

📄 License

  • AGA8-JS: GNU Affero General Public License v3.0
  • Original AGA8 Implementation: Public Domain (NIST)

🙏 Acknowledgments

  • Original AGA8 implementation by the National Institute of Standards and Technology (NIST)
  • WebAssembly port, AGA8 modifications and maintenance by Ronan LE MEILLAT

📧 Support