Skip to main content
Module

x/windows_service/mod.ts>WindowsService

Deno library to seamlessly integrate your application as a Windows service without any external tools.
Latest
class WindowsService
import { WindowsService } from "https://deno.land/x/windows_service@1.0.11/mod.ts";

WindowsService class for managing Windows services.

Constructors

new
WindowsService(serviceName: string)

Creates a new WindowsService instance and initializes win32 api

Methods

private
cleanup()

Stops the service.

Triggered when the dispatcher worker returns

private
logDebug(message: string)

Logs a debug message.

private
serviceCtrlHandler(controlCode: number, _eventType: number)

Handles service control events.

on(eventName: string, callback: unknown): void

Registers a callback function for a specific event.

run(mainFunction: (argc?: number, argv?: string[]) => Promise<void>)

Main entrypoint for the service.

ServiceMain(argc: number, argv: string[] | null)

ServiceMain function called by Service Control Manager (SCM).

Stops the service.