# textractor-wrapper

> Textractor wrapper for Node.js. Extracts text from video games and visual novels.

Latest version **2.0.1** (published 2019-07-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install textractor-wrapper
pnpm add textractor-wrapper
yarn add textractor-wrapper
bun add textractor-wrapper
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2019-07-03 |
| First published | 2019-02-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 27.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | tinyAdapter |
| Maintainers | tinyadapter |
| Keywords | textractor, text, hooker |

## Links

- npm: https://www.npmjs.com/package/textractor-wrapper
- Repository: https://github.com/tinyAdapter/node-textractor
- Homepage: https://github.com/tinyAdapter/node-textractor#readme
- Issues: https://github.com/tinyAdapter/node-textractor/issues
- npm.io page: https://npm.io/package/textractor-wrapper

## Dependencies (2)

- [scanf](https://npm.io/package/scanf.md) ^1.0.2
- [split](https://npm.io/package/split.md) ^1.0.1

## Alternatives

- [ext-list](https://npm.io/package/ext-list.md) — 6.3M weekly downloads
- [@lexical/selection](https://npm.io/package/@lexical/selection.md) — 3.8M weekly downloads
- [@lexical/text](https://npm.io/package/@lexical/text.md) — 3.6M weekly downloads
- [@lexical/clipboard](https://npm.io/package/@lexical/clipboard.md) — 3.0M weekly downloads
- [@tiptap/extension-mention](https://npm.io/package/@tiptap/extension-mention.md) — 3.0M weekly downloads

## Recent versions

- 2.0.1 (latest) — 2019-07-03
- 2.0.0 — 2019-06-30
- 1.1.0 — 2019-02-07
- 1.0.4 — 2019-02-07
- 1.0.3 — 2019-02-07
- 1.0.2 — 2019-02-03
- 1.0.1 — 2019-02-02
- 1.0.0 — 2019-02-01

## README

# node-textractor

Textractor wrapper for Node.js.

[Textractor](https://github.com/Artikash/Textractor) (a.k.a. NextHooker) is an open-source x86/x64 text hooker for Windows/Wine based off of ITHVNR.

## Requirements

- Textractor v4.3.0 and above

## Example

```js
const Textractor = require("textractor").Textractor;

let t = new Textractor("X:/path/to/TextractorCLI.exe");

t.on("output", output => {
  console.log(`[${output.handle}]: ${output.text}`);
});
t.start();
t.attach(PID);
```

## API

### Textractor(path: string)

The constructor.

#### Params

- `path` - Path to TextractorCLI.exe

### start(): void

Start Textractor process.

### attach(pid: number): void

Attach text hooker to a specific process.

#### Params

- `pid` - Process ID

#### Throws

- _RangeError_ if pid is invalid
- _ReferenceError_ if Textractor process is not started

### detach(pid: number): void

Detach text hooker to a specific process.

#### Params

- `pid` - Process ID

#### Throws

- _ReferenceError_ if the process has not been attached

### hook(pid: number, code: string): void

Inject a hook into a specific process.

Supports **/H** hook code and **/R** read code.

#### Params

- `pid` - Process ID

#### Throws

- _ReferenceError_ if Textractor process is not started
- _ReferenceError_ if the process has not been attached
- _SyntaxError_ if code is invalid

### on(event: "output", listener: (output: TextOutputObject) => void): this

Specify callback function when text outputs.

#### Params

- `event` - Must be "output"
- `listener` - The callback function

#### TextOutputObject

```ts
{
  handle: number; // hook index
  pid: number; // process ID
  addr: number; // hook address
  ctx: number; // hook context
  ctx2: number; // hook context 2
  name: string; // hook name
  code: string; // hook code
  text: string; // output text
}
```

### exec(command: string): void

Execute a command manually.

#### Params

- `command` - The command to execute

#### Throws

- _ReferenceError_ if Textractor process is not started

### stop(): void

Stop Textractor process.

## License

MIT

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