Skip to content

Latest commit

 

History

History
52 lines (36 loc) · 925 Bytes

README.md

File metadata and controls

52 lines (36 loc) · 925 Bytes

catalog.js

A JavaScript API for the Middlebury course catalog.

Build Status

Install

$ npm install --save middlebury-catalog

Examples

Scrape the course catalog for term 201590. The URL is automatically constructed based on the term.

const catalog = require('middlebury-catalog');

catalog('201590')
  .catalogFromUrl()
  .then(function (catalog) {
    console.log(catalog.courses[0]);
  });

Specify an XML file to scrape from. You must still provide a term to catalog.

const catalog = require('middlebury-catalog');

catalog('201590')
  .catalogFromFile('test/test.xml')
  .then(function (catalog) {
    console.log(catalog.courses[0]);
  });

Develop

Clone the repository then run:

$ npm install

Run the tests with:

$ npm test