Add package in your project:
deno add @bukhalo/wol
Or add package without install step:
import { wake } from "jsr:@bukhalo/wol";
Execute wake
function from package:
import { wake } from "@bukhalo/wol";
wake("00:00:00:00:00:00");
Important
Don't forget to add the --unstable-net
flag to your startup task:
// deno.json
{
"tasks": {
"start": "deno run --unstable-net main.ts"
}
}
Also you can use magicPacket
function for generate magic packet only:
import { magicPacket } from '@bukhalo/wol`
const packet = magicPacket('00:00:00:00:00:00');