wireguard-tools
Version:
The best way to interact with WireGuard from Node
10 lines (9 loc) • 596 B
TypeScript
import { WgConfigObject } from '../types/WgConfigObject';
/** Generate a string version of the WgConfig suitable for saving to a Wireguard Config file (wg0.conf) */
export declare const generateConfigString: (conf: WgConfigObject) => string;
/**
* Parse a WireGuard config file (wg0.conf) into a WgConfig object for use in Javascript-land
* If no valid interface is found in the config, it will throw an error
* If a peer in the peers array is invalid, it will throw an error
*/
export declare const parseConfigString: (configString: string) => Pick<WgConfigObject, "wgInterface" | "peers">;