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

coolprop-wasm

v6.6.0

Published

CoolProp thermodynamic property library compiled to WebAssembly - Complete AbstractState API

Readme

CoolProp WASM JavaScript Wrapper

A comprehensive WebAssembly (WASM) wrapper for CoolProp that provides full access to the AbstractState class and low-level API functionality in JavaScript environments.

🚀 Quick Start

Installation

# Clone the repository
git clone https://github.com/CoolProp/CoolProp.git
cd CoolProp/wrappers/Javascript

# Install dependencies (if using Node.js)
npm install

Basic Usage

// Node.js
import Module from './coolprop.js';
const CoolProp = await Module();

// Create an AbstractState instance using factory function
const state = CoolProp.factory('HEOS', 'Water');

// Update state with temperature and pressure using correct enum access
state.update(CoolProp.input_pairs.PT_INPUTS, 101325, 373.15); // 1 atm, 100°C

// Get properties
console.log('Density:', state.rhomass(), 'kg/m³');
console.log('Enthalpy:', state.hmass(), 'J/kg');

Browser Usage

<!DOCTYPE html>
<html>
<head>
    <title>CoolProp WASM Demo</title>
</head>
<body>
    <script src="coolprop.js"></script>
    <script>
        Module().then(CoolProp => {
            const state = CoolProp.factory('HEOS', 'Water');
            state.update(CoolProp.input_pairs.PT_INPUTS, 101325, 373.15);
            console.log('Temperature:', state.T(), 'K');
        });
    </script>
</body>
</html>

🧪 Testing

Run All Tests

# Comprehensive validation (all test types)
node scripts/run_comprehensive_validation.mjs

# Enhanced test suite (performance, memory, browser)
node scripts/run_enhanced_test_suite.mjs

# Final integration tests
node scripts/run_final_integration_tests.mjs

Run Specific Test Categories

# Unit tests
node tests/unit/test_basic.mjs

# Property-based tests
node tests/property-based/test_derivative_accuracy.mjs

# Integration tests
node tests/integration/test_error_handling.mjs

# Performance tests
node tests/performance/test_performance_validation.mjs

# Memory tests
node tests/memory/test_memory_management.mjs

# Browser tests (open in browser)
open tests/browser/test_browser_compatibility.html

🔧 Building

Standard Build

# Basic build
./build/build.sh

# Enhanced build with optimizations
./build/build_enhanced.sh

Docker Build

# Build using Docker
./build/docker_build.sh

# Or use Docker Compose
docker-compose -f build/docker-compose.yml up

📚 Documentation

🎯 Features

Core Functionality

  • ✅ Complete AbstractState class exposure
  • ✅ All thermodynamic property calculations
  • ✅ Derivative calculations (1st, 2nd, 3rd, 4th order)
  • ✅ Mixture handling with composition management
  • ✅ Phase envelope calculations
  • ✅ Saturation property calculations
  • ✅ Critical and limiting property access
  • ✅ Ancillary equation support

Developer Experience

  • ✅ Full TypeScript definitions
  • ✅ Comprehensive error handling
  • ✅ Memory management and leak prevention
  • ✅ Browser and Node.js compatibility
  • ✅ Build tool integration (Webpack, Rollup, Vite)
  • ✅ Extensive test coverage (unit, integration, property-based)
  • ✅ Performance benchmarking
  • ✅ Debug utilities

Quality Assurance

  • ✅ Property-based testing framework
  • ✅ Cross-browser compatibility testing
  • ✅ Memory leak detection
  • ✅ Performance regression testing
  • ✅ Comprehensive validation suite

🤝 Contributing

  1. Follow the organized directory structure
  2. Add tests in the appropriate test category
  3. Update documentation for new features
  4. Run the comprehensive validation suite before submitting

📄 License

This project follows the same license as CoolProp. See the main CoolProp repository for license details.

🔗 Links


Last Updated: January 2, 2026 Version: Enhanced WASM Implementation v2.0