Skip to content

kjappelbaum/pubchem

 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • JavaScript 100.0%