pubchem
TypeScript icon, indicating that this package has built-in type declarations

1.3.0 • Public • Published

PubChem

NPM version build status Test coverage npm download

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

CDN

Online demo

License

MIT

Package Sidebar

Install

npm i pubchem

Weekly Downloads

82

Version

1.3.0

License

MIT

Unpacked Size

318 kB

Total Files

372

Last publish

Collaborators

  • cheminfo-bot