generate-ctrl-c-event
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/generate-ctrl-c-event package

2.0.1 • Public • Published

generate-ctrl-c-event

Generate ctrl-c (or ctrl-break) events on Windows by calling Kernel32::GenerateConsoleCtrlEvent()

npm version dependencies status optional dependencies status Code Climate maintainability LGTM alerts Known Vulnerabilities GitHub issues welcome GitHub pull requests welcome License: MIT

Only works on Windows. Cannot be installed on other platforms due to it's package.os. If you need to use this in cross-platform code, install it as an optional dependency and it will be skipped when installing your package on a non-Windows platforms.

Calls Kernel32::GenerateConsoleCtrlEvent(), via either a Foreign Function Interface (FFI) if available, or a PowerShell script as a fallback.

Please consult the official docs on Kernel32::GenerateConsoleCtrlEvent() for semantics.

Exports:

function generateCtrlC(): boolean
function generateCtrlCAsync(): Promise<boolean>
function generateCtrlBreak(dwProcessGroupId: number = 0): boolean
function generateCtrlBreakAsync(dwProcessGroupId: number = 0): Promise<boolean>

Package Sidebar

Install

npm i generate-ctrl-c-event

Weekly Downloads

64

Version

2.0.1

License

MIT

Unpacked Size

9.75 kB

Total Files

7

Last publish

Collaborators

  • zen_flow