unicourse
TypeScript icon, indicating that this package has built-in type declarations

1.0.0-alpha.16 • Public • Published

UniCourse Client

This is the client library for UniCourse.

If you are looking for the command line tool, see @unicourse-tw/cli.

This library is targeting Node.js and browsers, it should work in both environments.

Examples

The following examples are in TypeScript (ESM). However, you can use it in CommonJS format as well.

import { UniCourse } from "unicourse";

const uni = new UniCourse();
const user = await uni.login("username", "password");
console.log("Logged in as", user.username);

You can also point the client to a different UniCourse server:

const uni = new UniCourse(undefined, {
    server: "https://unicourse.example.com"
});

Reuse a existing token is also possible:

const uni = new UniCourse("token");

Readme

Keywords

none

Package Sidebar

Install

npm i unicourse

Weekly Downloads

0

Version

1.0.0-alpha.16

License

MIT

Unpacked Size

26.5 kB

Total Files

6

Last publish

Collaborators

  • jacoblincool