# hostapd-config

> Nodejs wrapper to configure and run hostapd

Latest version **1.0.4** (published 2021-09-04) · ISC license · 0 weekly downloads

## Install

```sh
npm install hostapd-config
pnpm add hostapd-config
yarn add hostapd-config
bun add hostapd-config
```

## 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.4 |
| Published | 2021-09-04 |
| First published | 2021-08-25 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 12.3 KB |
| Known vulnerabilities | 0 (+5 in 2 direct dependencies) |
| Install scripts | no |
| Author | Justin Schwartzbeck |
| Maintainers | justinschw |
| Keywords | hostapd, linux, networking, wireless |

## Links

- npm: https://www.npmjs.com/package/hostapd-config
- Repository: https://github.com/justinschw/hostapd-config
- Homepage: https://github.com/justinschw/hostapd-config#readme
- Issues: https://github.com/justinschw/hostapd-config/issues
- npm.io page: https://npm.io/package/hostapd-config

## Dependencies (3)

- [joi](https://npm.io/package/joi.md) 17.4.2
- [uuid](https://npm.io/package/uuid.md) 8.3.2
- [systemctl](https://npm.io/package/systemctl.md) 0.2.2

## Recent versions

- 1.0.4 (latest) — 2021-09-04
- 1.0.3 — 2021-09-03
- 1.0.2 — 2021-08-29
- 1.0.1 — 2021-08-25

## README

# hostapd-config
Nodejs wrapper to configure and run hostapd

## Usage
```
/*
 * The following creates a basic WPA WiFi network
 * on a raspberry pi 3B.
 */
const Hostapd = require('hostapd-config');

const options = {
  iface: 'wlan0',
  ssid: 'TellMyWiFiLoveHer',
  wpaPassphrase: 'supersecretpassword'
};

const hostapd = new Hostapd(options);

// Start independent daemon
hostapd.start().then(result => {
  console.log(`Hostapd started with code ${result.code}`);
}).catch(err => {
  console.log(`Hostapd failed to start: ${err.message}`);
});

// alternatively you can start it as a systemctl service
hostapd.restart().then(() => {
  console.log('Service started successfully');
});
```

## Options
|Option|Type|Description|default|required|
|------|----|-----------|-------|--------|
|iface|String|Network Interface hostapd listens on|wlan0|default|
|ssid|String|SSID (display name of your WiFi network)|N/A|yes|
|wpaPassphrase|String|Your WiFi password|N/A|yes|
|driver|String|WiFi driver to use|nl80211 (raspberry pi wifi)|default|
|hwMode|String|**hw_mode** option in hostapd|g|default|
|channel|Integer|**channel** option in hostapd|11|default|
|wpa|Integer|**wpa** option in hostapd|1|default|
|wpaKeyMgmt|String|**wpa_key_mgmt** option in hostapd|WPA-PSK|default|
|wpaPairwise|String|**wpa_pairwise** option in hostapd|TKIP CCMP|default|
|wpaPtkRekey|Integer|**wpa_ptk_rekey** option in hostapd|600|default|
|pidFile|String|Path to pid file|/tmp/{uuidv4}.conf|default|
|configFilePath|String|Path to hostapd config file|/etc/hostapd/hostapd.conf|default|

For more info on **bolded** options, see the hostapd man page.

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