2.0.2 • Published 8 months ago

node-gdx v2.0.2

Weekly downloads
6
License
MIT
Repository
github
Last release
8 months ago

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.

2.0.2

8 months ago

2.0.1

8 months ago

2.0.0

8 months ago

1.0.5

4 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago