node-gdx

2.0.2 • Public • Published

node-gdx

Read GAMS GDX files in Node.js. Does NOT require a GAMS installation for macOS & Windows systems.

Installation

npm i node-gdx

Usage

const gdx = require('node-gdx')({
  gamsPath: "/path/to/gams/installation" // this is optional for macOS & Windows!
})

// read a whole gdx file
gdx.read('path/to/file.gdx')
  .then(data => {
    /* where data = {
      Demand: [{
          '0': 'New-York',
          Value: 324
        },
        ...
      ]
    }
    */
  })
  .catch(e => {
    console.error(e)
  })
  
// read a single symbol
gdx.read('path/to/file.gdx', 'Demand')
  .then(data => {
    /* where data = [{
          '0': 'New-York',
          Value: 324
        },
        ...
      ]
    */
  })
  .catch(e => {
    console.error(e)
  })

API

read(file: string, symbol: string, overrideDllPath: string)

Read a GDX file from disk. Returns all symbols in the GDX container by default, unless otherwise specified by the optional second function argument.

/node-gdx/

    Package Sidebar

    Install

    npm i node-gdx

    Weekly Downloads

    9

    Version

    2.0.2

    License

    MIT

    Unpacked Size

    7.94 MB

    Total Files

    87

    Last publish

    Collaborators

    • chrispahm