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

grades-sdk

v0.4.3

Published

An SDK for easy integration of Grades classification system.

Readme

Grades SDK

GradesSDK is a tool for integration of Grades classification system into your app. It provides a set of functions and for simple communication with the Grades service, eliminating the need of using HTTP requests during your development.

Links:

Installing

npm install grades-sdk

Preparation

In order to gain access to Grades API, it is first necessary to perform the following two-step process:

  1. Create a project in the Apps Manager portal
  2. Add a new application to your project
  3. Pass the client ID and SECRET of the added app to the GradesSDK constructor as shown below. The module will manage the authentication from now on.

Configuration

const sdk = require('grades-sdk');
const {GradesURL} = require("grades-sdk/lib/apiRequestor");

const grades = new sdk.GradesSDK(GradesURL.Live, clientId, clientSecret);
const myCourse = grades.getCourse('NI-XYZ');

All set! The grades instance can be used to retrieve the semester code or to return a Course instance. To manage a course – its definition hierarchy, student groups and student classifications, the Course instance (named myCourse in the code snippet above) can be used.

Examples

The following code snippets show how the module can be used to perform a number of basic tasks.

Getting current semester code

async function getSemesterCode() {
    const semesterCode = await grades.getSemesterCode()
    console.log(semesterCode);
}

Getting course info

async function getInfoForMyCourse() {
    const courseInfo = await myCourse.getCourseInfo();
    console.log(courseInfo);
}

Getting the course's definition hierarchy

async function getDHForMyCourse() {
    const definitionHierarchy = await myCourse.definitions.getDefinitionHierarchy();
    console.log(definitionHierarchy);
}

Adding a new definition to the course's definition hierarchy

It will be necessary to add the following require statement to the top of your file to gain access to the Definition class provided by the module.

const {Definition} = require("grades-sdk/lib/definition");

The Definition constructor accepts any object that implements the DefnitionInterface. More detailed information about the classes and interfaces provided by this module can be found in the documentation. -> Just pull this project and open the docs/index.html file in a browser.

async function addDefinitionIntoDH() {
	const newDefinition = new Definition({
      identifier: 'test_definition',
      parentIdentifier: '',
      namesForLocales: {en: 'Test definition', cs: 'Testovací definice'},
      courseCode: 'PI-ARB',
      semesterCode: 'B202',
      expression: null,
      classificationType: "QUIZ",
      evaluationType: "MANUAL",
      minimumValue: 0,
      minimumRequiredValue: 7,
      maximumValue: 10,
      valueType: "NUMBER",
      hidden: false
    });
	
    await myCourse.definitions.createDefinitions(newDefinition);
}

Deleting a definition from the course's definition hierarchy

async function deleteDefinition(definitionIdentifier) {
  await myCourse.definitions.deleteDefinitions(definitionIdentifier);
  console.log("Definition deleted");
}

Getting the classifications of a student group

async function getGroupClassifications(groupCode) {
  const studentsClassifications = await myCourse.classifications
    .getStudentClassificationsForGroup(groupCode);
}