New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@chemistry/formula

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@chemistry/formula

Chemical formula parser

latest
Source
npmnpm
Version
3.1.3
Version published
Maintainers
1
Created
Source

@chemistry/formula

npm

Chemical formula parser — parse, stringify, and calculate molecular weight.

Installation

npm install @chemistry/formula

Usage

import { Formula } from '@chemistry/formula';

const parsed = Formula.parse('C2H5OH');
// { C: 2, H: 6, O: 1 }

const weight = Formula.convertToWeight(parsed);
// 46.069

const str = Formula.stringify(parsed);
// "C2H6O"

Features

  • Parse chemical formulas into element counts
  • Calculate molecular weight
  • Stringify parsed formulas back to string
  • Isomorphic — works in Node.js and browsers

License

MIT

Keywords

formula

FAQs

Package last updated on 27 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts