1.0.6 • Published 3 years ago
librusjs v1.0.6
librusjs
Javascript library to interact with librus api, and present complete data in nice way
FULL TYPESCRIPT SUPPORT!
doesnt work in browser because of cors
tested and works in node and react native
Installation:
npm install librusjs
Usage
import Librus from 'librusjs'
// or const Librus = require('librusjs').default
Librus("username", "password")
.then( (session) => {
session.getLuckyNumber().then( (num) => /* ... */);
session.getAccountInfo().then( (accInfo) => /* ... */);
session.getGrades().then( (grades) => /* ... */);
// getMostRecent?: boolean, lastXDays?: number
// both are optional, add to output
// most recently added grade and grades from last 7 days
session.getGrades(true, 7).then( (grades) => /* ... */);
// current week + includes school free days
session.getTimetable().then( (timetable) => /* ... */);
// optional - get timetable from other week
session.getTimetable("2022-06-20").then( (timetable) => /* ... */);
})
.catch( (err) => {
// Failed to auth!
console.log(err);
});