chematic-wasm
WebAssembly bindings for chematic, a pure-Rust cheminformatics library.
This crate exposes #[wasm_bindgen] bindings so that chematic can be used directly from JavaScript and TypeScript in the browser or Node.js.
Features
- Parse SMILES strings into molecule handles
- Compute molecular descriptors: molecular weight, TPSA, formula, heavy atom count, H-bond donors/acceptors
- Lipinski Rule-of-Five check
- Canonical SMILES generation
- ECFP4 fingerprints and Tanimoto similarity
Usage
Build with wasm-pack:
Then in JavaScript/TypeScript:
import init from './pkg/chematic_wasm.js';
await ;
const mol = ;
console.log; // 6
console.log; // ~78.11
console.log; // "C6H6"
console.log; // true
const aspirin = ;
const sim = ;
console.log; // < 1.0