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-node

v1.0.31

Published

A Node.js wrapper for CoolProp providing an easy-to-use interface for thermodynamic calculations and refrigerant properties. Unlike all the other CoolProp npm packages I've seen, this one should actually work. Please report any issues.

Readme

CoolProp-Node

A Node.js wrapper for CoolProp providing an easy-to-use interface for thermodynamic calculations and refrigerant properties. Unlike all the other CoolProp npm packages I've seen, this one should actually work. Please report any issues.

Installation

npm install coolprop-node

Features

  • Easy-to-use async interface for CoolProp
  • Unit conversion support (Temperature: K/C/F, Pressure: Pa/kPa/bar/psi)
  • Automatic initialization
  • Configurable defaults
  • Comprehensive error handling
  • Additional Refrigerant types not supported by CoolProp for superheat and subcooling:
    • R407F
    • R448A
    • R449A
    • R428A
    • R402A

Dependencies

No External Dependencies, as CoolProp.js and CoolProp.wasm are bundled with the package.

  • CoolProp for the powerful thermodynamic library

Quick Start

const nodeprop = require('coolprop-node');
async function example() {
    // Initialize with defaults (optional)
    await nodeprop.init({
        refrigerant: 'R404A',
        tempUnit: 'C',
        pressureUnit: 'bar'
    });
    // Calculate superheat
    const result = await nodeprop.calculateSuperheat({
        temperature: 25, // 25°C
        pressure: 10, // 10 bar
        refrigerant: 'R404A' // optional if set in init
    });
    console.log(result);
    
    // expected output:
    {
        type: 'success',
        superheat: 5.2,
        saturationTemperature: 19.8,
        refrigerant: 'R404A',
        units: {
            temperature: 'C',
            pressure: 'bar'
        }
    }
}
example();

API Reference

nodeprop.init(config)

Initializes the wrapper with optional configuration.

Note: Calling init() is optional. The library will initialize automatically when you make your first call to any function, but you must provide a refrigerant parameter in that first call.
await nodeprop.init({
    refrigerant: 'R404A', // Required on first init
    tempUnit: 'C', // Optional, defaults to 'K'
    pressureUnit: 'bar' // Optional, defaults to 'Pa'
});

nodeprop.calculateSuperheat(input)

Calculates superheat for a given refrigerant.

const result = await nodeprop.calculateSuperheat({
    temperature: 25, // 25°C
    pressure: 10, // 10 bar
    refrigerant: 'R404A' // optional if set in init
});


returns:
    {
        type: 'success',
        superheat: 5.2,
        saturationTemperature: 19.8,
        refrigerant: 'R404A',
        units: {
            temperature: 'C',
            pressure: 'bar'
        }
    }

nodeprop.getSaturationTemperature(input)

Calculates saturation temperature for a given refrigerant.

const result = await nodeprop.calculateSaturationTemperature({
    temperature: 25, // 25°C
    pressure: 10, // 10 bar
    refrigerant: 'R404A' // optional if set in init
});

returns:
    {
        type: 'success',
        temperature: 19.8,
        refrigerant: 'R404A',
        units: {
            temperature: 'C',
            pressure: 'bar'
        }
    }

nodeprop.getSaturationPressure(input)

Calculates saturation pressure for a given refrigerant.

const result = await nodeprop.calculateSaturationPressure({
    temperature: 25, // 25°C
    refrigerant: 'R404A' // optional if set in init
});

returns:
    {
        type: 'success',
        pressure: 10,
        refrigerant: 'R404A',
        units: {
            temperature: 'C',
            pressure: 'bar'
        }
    }   

nodeprop.calculateSubcooling(input)

Calculates subcooling for a given refrigerant.

const result = await nodeprop.calculateSubcooling({
    temperature: 25, // 25°C
    pressure: 10, // 10 bar
    refrigerant: 'R404A' // optional if set in init
});

returns:
    {
        type: 'success',
        subcooling: 5.2,
        saturationTemperature: 19.8,
        refrigerant: 'R404A',
        units: {
            temperature: 'C',
            pressure: 'bar'
        }
    }

nodeprop.calculateSuperheat(input)

Calculates superheat for a given refrigerant.

const result = await nodeprop.calculateSuperheat({
    temperature: 25, // 25°C
    pressure: 10, // 10 bar
    refrigerant: 'R404A' // optional if set in init
});

returns:
    {
        type: 'success',
        superheat: 5.2,
        saturationTemperature: 19.8,
        refrigerant: 'R404A',
        units: {
            temperature: 'C',
            pressure: 'bar'
        }
    }

nodeprop.getProperties(input)

Gets all properties for a given refrigerant.

const result = await nodeprop.getProperties({
    temperature: 25, // 25°C
    pressure: 10, // 10 bar
    refrigerant: 'R404A' // optional if set in init
});

returns:
    {
        type: 'success',
        properties: {
            temperature: 25, // in configured temperature unit (e.g., °C)
            pressure: 10, // in configured pressure unit (e.g., bar)
            density: 1234.56, // in kg/m³
            enthalpy: 400000, // in J/kg
            entropy: 1750, // in J/kg/K
            quality: 1, // dimensionless (0-1)
            conductivity: 0.013, // in W/m/K
            viscosity: 1.2e-5, // in Pa·s
            specificHeat: 850 // in J/kg/K
        },
        refrigerant: 'R404A',
        units: {
            temperature: 'C',
            pressure: 'bar',
            density: 'kg/m³',
            enthalpy: 'J/kg',
            entropy: 'J/kg/K',
            quality: 'dimensionless',
            conductivity: 'W/m/K',
            viscosity: 'Pa·s',
            specificHeat: 'J/kg/K'
        }
    }

nodeprop.PropsSI

Direct access to CoolProp's PropsSI function.

const PropsSI = await nodeprop.getPropsSI();
const result = PropsSI('H', 'T', 298.15, 'P', 101325, 'R134a');

Error Handling

const result = await nodeprop.calculateSuperheat({
    temperature: 25, // 25°C
    pressure: 10, // 10 bar
    refrigerant: 'R404' // Invalid refrigerant. Must be supported by CoolProp, but R404 is not even a valid refrigerant.
});

returns:
    {
        type: 'error',
        message: 'Invalid refrigerant'
    }

Acknowledgements

  • CoolProp for the powerful thermodynamic library