npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

canvas-student-wrapper

v1.1.1

Published

Exposes an object that contains a student's courses, their announcements, and their grades.

Downloads

5

Readme

Canvas Student Wrapper

Exposes an object that contains a student's courses, their announcements, and their grades.

Usage:

Install with npm install canvas-student-wrapper -S and import using

import StudentCanvas, { RedactedCanvas } from 'canvas-student-wrapper' in a .mjs file.

You can generate a student access token by going to canvas, navigating to the profile settting page, and clicking on + New Access Token. You can give this access token any name.

Student Canvas

Acts as an interface for everything a student can see on their course page. This includes read status for announcements and the status of their assignments.

To create an instance of StudentCanvas, use const canvas = new StudentCavas(ACCESS_TOKEN, SUBDOMAIN).

StudentCanvas Methods:

  • getActiveCourses(): Gets basic information about all courses the user is currently enrolled in. This does not include announcements or assignments.
  • getAllCourses(): Gets basic information about all courses the user has ever been enrolled in. This does not include announcements or assignments.
  • getAnnouncements(COURSE_IDS): Get the announcements for all courses in COURSE_IDS.
  • getAssignments(COURSE_IDS): Get the assignments for all courses in COURSE_IDS.
  • getCourseExtras(COURSE_IDS): Gets both announcements and assignments for courses in COURSE_IDS.
  • update(): Refreshes all courses, announcements, and assignments that are currently stored.

Redacted Canvas

This has most of the same functions as the student canvas, but it removes all sensitive information and autopopulates all currently active lectures.

To create an instance of RedactedCanvas, use const canvas = await RedactedCanvas.setup(ACCESS_TOKEN, SUBDOMAIN).

The update method of RedactedCanvas only updates active courses.

Course Object

Course objects Contain the following properties:

| Key | Property | | --- | --- | | id | A number that uniquely identifies the course on canvas. | | name | The long, descriptive name of the course. | | code | The course code. | | startDate | A date object with the start date of the course. | | active | A boolean representing whether the student is currently in the course. | | calendarLink | A link to an ics file that has the course calendar. | | term | An object with the keys name, startDate, and endDate that represents the term the course was taken in. | | courseImg | A link to the front image of the course. | | totalStudents | The total number of students in the course. | | teachers | An array of objects with the keys avatar, link, and name that identify the course instructors. | | tabs | An array of objects with the keys id, label, link, position, and type that point to canvas pages. | | announcements | An array of Annoucement objects (Reference Below). | | assignments | An array of Assignment objects (Reference Below). |

Annoucement Object

Annoucement objects contain the following properties:

| Key | Property | | --- | --- | | position | Number that sorts the annoucements. | | title | The title of the annoucement. | | message | The body text of the annoucement | | read | Whether the user has opened this announcement. | | author | An object with a name key that identifies the person who posted the announcement. | | link | A link to the announcement page. | | date | The date that the announcement was made. |

Assignment Object

Assignment objects contain the following properties:

| Key | Property | | --- | --- | | position | Number that sorts the annoucements. | | name | The title of the assignment. | | description | A detailed description of the assignment. | | dueDate | A date object representing the due date. | | unlockDate | A date object representing the date the assignment will be available at. | | counts | A boolean value representing whether the assignment will effect the final grade. | | allowedAttempts | A number representing the number of times the user can submit. | | submitted | A boolean representing whether the user has submitted. | | link | A link to the assignment page. | | submission | A Submission object. (Reference Below) | | possiblePoints | A number representing the max number of points on the assignment | | submitted | Whether the student has submitted this assignment. |

Submission Object

Submission objects contain the following properties:

| Key | Property | | --- | --- | | score | A number representing how many points the student got. | | possiblePoints | The max number of points that could be achieved. | | submissionDate | The date that the user submitted. | | gradedDate | The date that the submission was graded. | | graded | A boolean representing if the submission has been graded. | | late | A boolean representing if the submission was late. | | missing | A boolean representing if the submission is missing. |