# acorn-api

> University of Toronto Acorn API

Latest version **1.0.2** (published 2017-10-15) · ISC license · 0 weekly downloads

## Install

```sh
npm install acorn-api
pnpm add acorn-api
yarn add acorn-api
bun add acorn-api
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2017-10-15 |
| First published | 2017-10-14 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 11 |
| Known vulnerabilities | 0 (+6 in 3 direct dependencies) |
| Install scripts | no |
| GitHub stars | 16 |
| Author | Chenlei Hu |
| Maintainers | k1oride |
| Keywords | Acorn |

## Links

- npm: https://www.npmjs.com/package/acorn-api
- Repository: https://github.com/huchenlei/acorn-api-js
- Homepage: https://github.com/huchenlei/acorn-api-js#readme
- Issues: https://github.com/huchenlei/acorn-api-js/issues
- npm.io page: https://npm.io/package/acorn-api

## Dependencies (11)

- [lodash](https://npm.io/package/lodash.md) ^4.17.4
- [request](https://npm.io/package/request.md) ^2.82.0
- [libxmljs](https://npm.io/package/libxmljs.md) ^0.18.7
- [typescript](https://npm.io/package/typescript.md) ^2.5.2
- [tough-cookie](https://npm.io/package/tough-cookie.md) ^2.3.3
- [@types/lodash](https://npm.io/package/@types/lodash.md) ^4.14.77
- [@types/request](https://npm.io/package/@types/request.md) ^2.0.3
- [@types/libxmljs](https://npm.io/package/@types/libxmljs.md) ^0.14.30
- [request-promise](https://npm.io/package/request-promise.md) ^4.2.2
- [@types/tough-cookie](https://npm.io/package/@types/tough-cookie.md) ^2.3.1
- [@types/request-promise](https://npm.io/package/@types/request-promise.md) ^4.1.37

## Recent versions

- 1.0.2 (latest) — 2017-10-15
- 1.0.1 — 2017-10-14
- 1.0.0 — 2017-10-14

## README

# Acorn API (typescript)
This project is inspired by [AcornAPI](https://github.com/LesterLyu/AcornAPI)
 which is an Acorn API written in Java.

## Installation
```bash
npm install acorn-api --save
```

## Example

### Login
```javascript
import { Acorn } from 'acorn-api-js';
const example = new Acorn();
example.basic.login('user', 'pass');
```

### Get Registrations
```javascript
example.course.getEligibleRegistrations();
```

### Get Student Courses
```javascript
example.course.getEnrolledCourses();
example.course.getCartedCourses();
```

### Get Course Info (Can also use it to get waiting list rank for a waitlisted course)
```javascript
int registrationIndex = 0;
const courseCode = "CSC373H1", sectionCode = "Y", courseSessionCode = "20175";
const course = example.getExtraCourseInfo(registrationIndex, courseCode, courseSessionCode, sectionCode);
```

### Enroll a Course (Not yet tested)
```javascript
int registrationIndex = 0;
const courseCode = "CSC373H1", sectionCode = "Y", lecSection = "LEC,5101";
const result = example.course.enroll(registrationIndex, courseCode, sectionCode, lecSection);
```

### Get Current Transcript
```javascript
const academicReport = example.academic.getAcademicHistory();
```

---
_Source: https://npm.io/package/acorn-api · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
