const ns = require ('ns-api') ({
  username: 'api-username',
  password: 'api-password'
});

// Travel parameters
const params = {
  fromStation: 'Amersfoort',
  toStation: 'Den Haag'
};

// console.log does not log >3 levels
function myCallback (err, data) {
  console.dir (err || data, {
    depth: null,
    colors: true
  });
}

// Get travel advise
ns.reisadvies (params, myCallback);

const NSAPI = require ('ns-api');
const ns = new NSAPI ({
  key: 'abc123',
});

// console.log does not log >3 levels
function output (data) {
  console.dir (data, {
    depth: null,
    colors: true,
  });
}

// Travel parameters
const params = {
  fromStation: 'Amersfoort',
  toStation: 'Den Haag',
};

// Get travel advise
ns.trips (params)
  .then (output)
  .catch (console.error)
;

Rewrite to v3 interface