cs10 / node-canvas-lms

A simple (WIP) node wrapper for the Canvas LMS API
7 stars 4 forks source link
canvas-lms education

canvas-lms

A simple node.js wrapper for the Canvas LMS API, with some sugar!

Quick Overview

The only required parameter is host, but in most cases, you'll also want an auth token to do anything useful.

var Canvas = require('canvas-lms');

var lms = new Canvas({
    host: 'https://canvas.instructure.com',
    token: 'YOUR-TOKEN',
    name: ' (Optional) My Awesome Canvas Site'
});

// OR
var lms = new Canvas('https://canvas.instructure.com', 'YOUR-TOKEN', options);

The Cavnas object is a very simple API wrapper based around requests, designed to allow easier access. There's two basics:

Functions

A Canvas object has 4 main functions: get, post, put, delete.

Shorthand

All functions support a shorthand format, where query and form are empty. In that case the method signatures look like this:

Course Objects

FUTURE

Requirements

canvas-lms makes use of ES6, so please use Node.js 4.2.x or newer. To use an older version of node, please use the v0.0.7 tag. 4.2 has LTS; this hopefully isn't a terrible restriction!

Development

The master branch tracks the stable version, which is published to npm. Development occurs on the dev branch. Currently This is going through a pretty big update, so be sure to check that out.