# @foundryapp/accessibility-node

> `yarn add @foundryapp/accessibility-node`

Latest version **1.0.14** (published 2020-08-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install @foundryapp/accessibility-node
pnpm add @foundryapp/accessibility-node
yarn add @foundryapp/accessibility-node
bun add @foundryapp/accessibility-node
```

## 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 | 1.0.14 |
| Published | 2020-08-15 |
| First published | 2020-08-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 435.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| Maintainers | mlejva, valeto |

## Links

- npm: https://www.npmjs.com/package/@foundryapp/accessibility-node
- npm.io page: https://npm.io/package/@foundryapp/accessibility-node

## Dependencies (1)

- [node-addon-api](https://npm.io/package/node-addon-api.md) ^3.0.0

## Recent versions

- 1.0.14 (latest) — 2020-08-15
- 1.0.13 — 2020-08-15
- 1.0.12 — 2020-08-15
- 1.0.11 — 2020-08-15
- 1.0.10 — 2020-08-15
- 1.0.9 — 2020-08-15
- 1.0.8 — 2020-08-15
- 1.0.7 — 2020-08-15
- 1.0.6 — 2020-08-15
- 1.0.5 — 2020-08-14
- 1.0.4 — 2020-08-13
- 1.0.3 — 2020-08-13
- 1.0.2 — 2020-08-13
- 1.0.1 — 2020-08-13

## README

## Installation & usage
`yarn add @foundryapp/accessibility-node`

### Initialization
```javascript
const ax = require('@foundryapp/accessibility-node'); // ax means accessibility
```

## Methods

### `isProcessTrusted() => boolean`
```javascript
// isProcessTrusted() returns boolean indicating whether a process has accessibility permissions.
// If the process isn't trusted, the method will also prompt user to give this process accessibility permissions.
const isTrusted = ax.isProcessTrusted();
```

### `isAppRunning(bundleID: boolean) => boolean`
```javascript
const isRunning = ax.isAppRunning('com.apple.Terminal');
```

### `launchApp(bundleID: string, (err) => void)`
```javascript
// The exact behavior of the launch depends on a target app but usually it means
// that also a new window of that app is launched. So there's no need to call
// createNewWindow().
ax.launchApp('com.apple.Terminal', (err) => {
  if (!err) {
    console.log('App successfully launched');
  } else {
    console.error(err);
  }
});
```

### `createNewWindow(bundleID: string, (err) => void)`
```javascript
// App must be running, otherwise error is passed to a callback.
// This might take a few seconds to complete.
ax.createNewWindow('com.apple.Terminal', (err) => {
  if (!err) {
    console.log('Window created');
  } else {
    console.error(err);
  }
});
```




## TODO
- Add Typescript typings

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