# regents-extractor

> Used to extract questions from NY State Regents Exams

Latest version **0.9.2** (published 2020-04-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install regents-extractor
pnpm add regents-extractor
yarn add regents-extractor
bun add regents-extractor
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.9.2 |
| Published | 2020-04-14 |
| First published | 2020-04-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 11.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | jbis9051 |

## Links

- npm: https://www.npmjs.com/package/regents-extractor
- Repository: https://github.com/jbis9051/regents-extractor
- Homepage: https://github.com/jbis9051/regents-extractor#readme
- Issues: https://github.com/jbis9051/regents-extractor/issues
- npm.io page: https://npm.io/package/regents-extractor

## Dependencies (1)

- [pdf.js-extract](https://npm.io/package/pdf.js-extract.md) ^0.1.4

## Recent versions

- 0.9.2 (latest) — 2020-04-14
- 0.9.1 — 2020-04-14
- 0.9.0 — 2020-04-14

## README

# NY Regents Extractor

Extracts multiple choice questions from [NY State Regents](https://www.nysedregents.org/).

Currently, output is only regular strings however this can be changed, see [Formatting](#Formatting). 

**Images are not supported and won't be extracted** .

# Install

```shell script
npm install regents-extractor
```

# Usage

```js
const {Exam, Document, Page, Question, TextsCollection} = require('regents-extractor');
```

Exam accepts a `string` or a `buffer` for the PDF and an optional `string` for the answers. If the answer string is provided, there must be a `\t` (tab) between questions and answers and a `\n` (line break) between questions. For example:

```js
    "1\t4\n" +
    "2\t3\n" +
```

# Example 

See the examples folder in the repo. 

**Note**: You must download the example regents from the commented URL for the example to work.


# Formatting

Currently, the `TextsCollection` class toString() method simply prints the string, however this can be changed. If you would like to detect super and subscripts you can be replacing the TextsCollection toString method with your own implementation. `textCollection.objs` contains PDFJS objects with x, y, height, width, font size, etc. information. 

I may add some simple HTML output soon, but probably not.

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