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

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.3.014latest

Version History

VersionDownloads (Last 7 Days)Published
1.3.014
1.2.01
1.1.00
1.0.00
0.10.11
0.10.03
0.9.376
0.9.20
0.9.10
0.9.00
0.8.00
0.7.00
0.6.00
0.5.00
0.4.10
0.4.00
0.3.20
0.3.10
0.3.00
0.2.00
0.1.00
0.0.35
0.0.20
0.0.10

Package Sidebar

Install

npm i pubchem

Weekly Downloads

54

Version

1.3.0

License

MIT

Unpacked Size

318 kB

Total Files

372

Last publish

Collaborators

  • cheminfo-bot