@lennyclaes/wake-on-lan
v1.0.1
Published
Broadcast wake-on-lan requests on your local network
Downloads
5
Readme
Wake-up
Send Wake-On-LAN requests on your local network
Installation
npm install -S @lennyclaes/wake-on-lan
Usage
There are several options to send the request.
You will always need to know for which MAC address the packet is meant.
import { sendWake } from '@lennyclaes/wake-on-lan';
const MAC = AA:BB:CC:11:22:33; // The MAC Address for which the request is meant
The first option is to call the function sendWake() with the MAC address as the only argument. The broadcast address will be calculated from the current connected network.
sendWake(MAC);
You can also specify a broadcast address. Since WOL is based on UDP we don't know whether the request was received successfully. You can specify an amount of retries. This defaults to 1.
sendWake(MAC, 1, '192.168.0.255');
Notes
In order for WOL to work it has to be enabled in BIOS. WOL only works on sleeping devices because the NIC has to be powered on.