pubchem
v1.3.0
Published
pubchem simplifies the data retrieval from the PubChem API.
Downloads
412
Maintainers
Readme
PubChem
Simplify the retrieval of information from PubChem using the PubChem JSON API.
Installation
$ npm i pubchem
Usage
import { Compound } from 'pubchem';
async function doAll() {
const compound = await Compound.fromSmiles('CCCCCBr', { cache });
console.log(compound.getCID());
const compoundData = await compound.getData();
const ghs = compoundData.ghs;
console.log(ghs);
const detailedGHS = compoundData.getGHS();
console.log(detailedGHS);
const computed = compoundData.computed;
console.log(computed);
const experimentalData = compoundData.getExperimentalData({
pressure: { targetUnits: 'torr' },
temperature: { targetUnits: '°C' },
});
console.log(experimentalData);
}
doAll();
You can run a working example using:
node test/simple.js