A Rutgers API wrapper based in node.js. In its current form, rutgersjs supports retrieving common information about bus routes, stops, and predictions. Further releases will include methods to interact with other facets of the Rutgers API such as Schedule of Classes and Events.
Error handling at this time is basically non-existent. Examples of this would be using the wrong route title or stop title as a parameter when invoking the appropriate functions. Because of this, if you are experiencing unexpected behavior, it is highly recommended that you double check your parameters against the list of valid parameters in the wiki. Proper error handling as well as more api services will be implemented in further releases
You should have Node.js installed on your system. The current version of rutgersjs was built using version 10.10.0 of Node.js
The easiest way to install Node for Mac would be to use Homebrew. From here the installation process is as easy as running the following command in your terminal
brew install node
Otherwise, Node can be installed using the installer.
For Windows, using the normal installer is most likely the easiest way to install Node and it can be found here.
A comprehensive guide can be found here.
To install rutgersjs for use in your Node project, navigate to your project's directory and install with npm
npm install --save rutgersjs
Using the module in your project is straightforward. Here's a simple example:
const rutgersjs = require('rutgersjs')
rutgersjs.getRouteList().then(function(list){
console.log(list)
}).catch(err => console.log(err))
Complete documentation and examples can be found on the projects wiki.
MIT
- Andrew Leonard