MolPrint NPM Package
Npm package providing random chemical compounds.
Installation
npm install molprint
Use
-
Import the package function..
import getCompound from "molprint";
-
Call the imported function..
const compound = getCompound(); console.log(compound);
This will output a random chemical compound with description to the console.
getCompound()
has an optional boolean parameterdetailed
: true by default.If
detailed
: false, only the compound will be output, without description.import getCompound from "./index.js"; console.log(getCompound(false)); //Out: { compound: 'Ethanol (C2H5OH)', description: null }