goeuro-api

A Node.js wrapper for the GoEuro API


Keywords
goeuro, api, node, javascript
License
MIT
Install
npm install goeuro-api@0.1.0

Documentation

GoEuro API

GoEuro API for Node.js.

Installation

npm install goeuro-api --save

How to use

import GoEuroAPI from 'goeuro-api';
const GoEuroClient = new GoEuroAPI();

// Init the search and get flights, trains and buses.
GoEuroClient.search(params)
  .then((response) => {
    GoEuroClient.flights()
      .then(flights => console.log(flights));

    GoEuroClient.trains()
      .then(trains => console.log(trains));

    GoEuroClient.buses()
      .then(buses => console.log(buses));
  })
  .catch((error) => console.log(error));

// Get buses by search_id
GoEuroClient
  .buses({ search_id: id })
  .then(buses => console.log(buses))
  .catch(error => console.log(error));