Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/osofem/molarmass
Get the molar mass of a compound in g/mol
https://github.com/osofem/molarmass
chemistry compound element mass mol molar mole molecule
Last synced: 7 days ago
JSON representation
Get the molar mass of a compound in g/mol
- Host: GitHub
- URL: https://github.com/osofem/molarmass
- Owner: osofem
- License: mit
- Created: 2017-08-01T12:58:27.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-02-08T12:13:51.000Z (almost 3 years ago)
- Last Synced: 2024-11-13T11:45:37.004Z (about 1 month ago)
- Topics: chemistry, compound, element, mass, mol, molar, mole, molecule
- Language: TypeScript
- Size: 36.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# molarmass.js
Get the molar mass of a compound in g/mol### Installation
```javascript
npm i molarmass.js
```### Usage
```javascript
const MolarMass = require('molarmass.js');
const mm = new MolarMass();
console.log(mm.getMolarMass("H2O")); //This logs 18.02
console.log(mm.getMolarMass("NaCl")); //This logs 58.44
console.log(mm.getMolarMass("CaSO4")); //This logs 136.14
console.log(mm.getMolarMass("Al2(SO4)3")); //This logs 342.15
console.log(mm.getMolarMass("CH3COOH")); //This logs 60.05
console.log(mm.getMolarMass("K2Cr2O7")); //This logs 294.18
console.log(mm.getMolarMass("(NH4)2Cr2O7")); //This logs 252.06
console.log(mm.getMolarMass("C12H22O11")); //This logs 342.30
```