4.0.1 • Published 6 months ago

chemical-formula v4.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
6 months ago

chemical-formula

Parse a chemical formula to get a count of each element in a compound.

Example

var chemicalFormula = require('chemical-formula');

chemicalFormula('H2O');
// => {H: 2, O: 1}

chemicalFormula('HOCH2CH2OH');
// => {H: 6, O: 2, C: 2}

Installation

$ npm install chemical-formula

API

var chemicalFormula = require('chemical-formula');

chemicalFormula(formula)

Parse String formula and return an Object whose keys are element symbols and values are the quantities of each element in formula.

4.0.1

6 months ago

4.0.0

7 months ago

3.0.0

11 months ago

2.0.0

6 years ago

1.1.2

8 years ago

1.1.1

9 years ago

1.1.0

10 years ago

1.0.0

10 years ago