CoolProp thermodynamic property library compiled to WebAssembly - Complete AbstractState API
npm install coolprop-wasmA comprehensive WebAssembly (WASM) wrapper for CoolProp that provides full access to the AbstractState class and low-level API functionality in JavaScript environments.
``bashClone the repository
git clone https://github.com/CoolProp/CoolProp.git
cd CoolProp/wrappers/Javascript
$3
`javascript
// 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');
`$3
`html
CoolProp WASM Demo
`๐งช Testing
$3
`bash
Comprehensive validation (all test types)
node scripts/run_comprehensive_validation.mjsEnhanced test suite (performance, memory, browser)
node scripts/run_enhanced_test_suite.mjsFinal integration tests
node scripts/run_final_integration_tests.mjs
`$3
`bash
Unit tests
node tests/unit/test_basic.mjsProperty-based tests
node tests/property-based/test_derivative_accuracy.mjsIntegration tests
node tests/integration/test_error_handling.mjsPerformance tests
node tests/performance/test_performance_validation.mjsMemory tests
node tests/memory/test_memory_management.mjsBrowser tests (open in browser)
open tests/browser/test_browser_compatibility.html
`๐ง Building
$3
`bash
Basic build
./build/build.shEnhanced build with optimizations
./build/build_enhanced.sh
`$3
`bash
Build using Docker
./build/docker_build.shOr use Docker Compose
docker-compose -f build/docker-compose.yml up
``- API Documentation - Complete API reference
- Deployment Guide - Integration and deployment
- Build System - Build configuration and options
- Testing Framework - Testing methodology and tools
- TypeScript Guide - TypeScript usage and definitions
- Troubleshooting - Common issues and solutions
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
This project follows the same license as CoolProp. See the main CoolProp repository for license details.
- CoolProp Main Repository
- CoolProp Documentation
- Low-Level API Documentation
---
Last Updated: January 2, 2026
Version: Enhanced WASM Implementation v2.0