kni-js

1.1.0 • Public • Published

KAMAR Notices Interface

Node/JavaScript/Typescript Edition

KNI (KAMAR Notices Interface) is a project designed to bring a way of accessing notices from the KAMAR portal software. KNIs goal is to produce usable libraries in as many languages as possible

NPM

KNI is available on NPM

$ npm i kni-js

You can provide Date objects, strings or null providing null or no value will use the current date

Retrieving Notices

const KNI = require('kni-js');

const kni = new KNI('portal.your.school.nz'); // Your school portal domain (or https://portal.your.school.nz)
kni.get(
    new Date() /* You can use date objects, string dates, and null (strings must be dd/MM/yyyy e.g 21/12/2021) */)
    .then(response => {
        const generalNotices = response.general; // Get the general notices
        const meetingNotices = response.meetings; // Get the meeting notices
    })
    .catch(err => { // If notices couldn't be retrieved
        console.error('Failed to retrieve notices: ' + err);
    })

By Jacobtread

Readme

Keywords

Package Sidebar

Install

npm i kni-js

Weekly Downloads

1

Version

1.1.0

License

MIT

Unpacked Size

26.9 kB

Total Files

7

Last publish

Collaborators

  • jacobtread