dependabot[bot]andSirherobrine23 e1e575e6dd
Test / Test Linux (20.x) (push) Successful in 3m41s
Test / Test Linux (18.x) (push) Successful in 3m43s
Test / Test Linux (21.x) (push) Successful in 3m33s
Test / Test Linux (latest) (push) Successful in 3m44s
Bump tar from 7.5.10 to 7.5.11
Bumps [tar](https://github.com/isaacs/node-tar) from 7.5.10 to 7.5.11.
- [Release notes](https://github.com/isaacs/node-tar/releases)
- [Changelog](https://github.com/isaacs/node-tar/blob/main/CHANGELOG.md)
- [Commits](https://github.com/isaacs/node-tar/compare/v7.5.10...v7.5.11)
2026-03-15 09:24:54 -03:00
2024-07-11 20:35:12 -03:00
2025-11-26 11:07:37 -03:00
2025-09-14 13:56:27 -03:00
2024-07-11 20:35:12 -03:00
2026-02-18 09:17:56 -03:00

Wireguard-tools for Nodejs

Manage your Wireguard interfaces directly from Node.js without any wrappers over wg or wg-quick

Warning

Require cmake and tools (GCC/GCC++, clang or Visual Studio) to build this addon

New versions does't include prebuilt binaries

import { setConfig, getConfig, key, Config } from "../index.js"

const tunName = process.platform === "darwin" ? "utun10" : "wg3" // Tunnel name, in MacOS/Darwin require start with utun prefix
let currentConfig: Config
try {
  currentConfig = await getConfig(tunName) // Check if exists tun
} catch {
  // Create new wireguard tun
  currentConfig = {
    name: tunName,
    privateKey: await key.privateKey(),
    portListen: 5820,
    address: [
      "10.66.66.1/24"
    ],
    peers: {}
  }
}

// Add new Peer
const peerPrivate = await key.privateKey()
currentConfig.peers[key.publicKey(peerPrivate)] = {
  presharedKey: await key.presharedKey(),
  allowedIPs: [
    "10.66.66.2/24"
  ]
}

// Deploy new Config
await setConfig(currentConfig)

Licences

  • Wireguard-tools.js: GPL-3.0

Wireguard

  • Embeddable-wg-library: LGPL-2.1+.
  • Wireguard-nt: GPL-2.0
  • Wireguard-go: MIT
Languages
C++ 45.4%
C 35.3%
TypeScript 14.8%
CMake 1.9%
Go 1.4%
Other 1.2%