{"_id":"@bun-win32/wscapi","_rev":"3-0c5240833898dff903b7d49c8d95df22","name":"@bun-win32/wscapi","dist-tags":{"latest":"2.0.1"},"versions":{"1.0.0":{"name":"@bun-win32/wscapi","version":"1.0.0","keywords":["bun","ffi","win32","windows","wscapi","bindings","typescript","dll"],"author":"Stev Peifer <stev@bell.net>","license":"MIT","_id":"@bun-win32/wscapi@1.0.0","maintainers":[{"name":"obscuritysrl","email":"stev@bell.net"}],"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dist":{"shasum":"e2e7574552437cc7212de84b19be477595b19579","tarball":"https://registry.npmjs.org/@bun-win32/wscapi/-/wscapi-1.0.0.tgz","fileCount":6,"integrity":"sha512-7cEJ61epqGUORSzBVjk3U8Ciemv1kF71gC1g41a/BOG6JqJknf4gsH1lIwUiYDTiy/Lm64HptWx4wKkYQ8T6JQ==","signatures":[{"sig":"MEYCIQDzBOmnF4jdiHFdxDHzLmVa1TQLQPseQZ88RU46VwQgpAIhALLPsyEccSkYMq/kYSwvwChrfqFeIApivOjIYPNmFAHN","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":11257},"main":"./index.ts","type":"module","module":"index.ts","shasum":"e2e7574552437cc7212de84b19be477595b19579","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:wsc-health-report":"bun ./example/wsc-health-report.ts","example:security-dashboard":"bun ./example/security-dashboard.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev@bell.net"},"_integrity":"sha512-7cEJ61epqGUORSzBVjk3U8Ciemv1kF71gC1g41a/BOG6JqJknf4gsH1lIwUiYDTiy/Lm64HptWx4wKkYQ8T6JQ==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/wscapi"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 WSCAPI bindings for Bun (FFI) on Windows.","directories":{},"sideEffects":false,"_nodeVersion":"24.3.0","dependencies":{"@bun-win32/core":"1.1.2"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest","@bun-win32/kernel32":"1.0.21"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/wscapi_1.0.0_1779150548643_0.3684738652898021","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@bun-win32/wscapi","version":"2.0.0","keywords":["bun","ffi","win32","windows","wscapi","bindings","typescript","dll"],"author":"Stev Peifer <stev.p@outlook.com>","license":"MIT","_id":"@bun-win32/wscapi@2.0.0","maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dist":{"shasum":"d32b3bbb5e8bd4c2782f368ab9d1501a3cdf890d","tarball":"https://registry.npmjs.org/@bun-win32/wscapi/-/wscapi-2.0.0.tgz","fileCount":6,"integrity":"sha512-8fiJAiOusKeVTcBS7MS/oFGUzsli9R20i+lgGMnMoRx9G+lHYJuX34ewecuPgCyEfz6WKVvr8EPXN5joItCrqg==","signatures":[{"sig":"MEQCIEWkbguK7t1Yz40QO6VQzc5MKK6SSZiTkOS1UXORqjYFAiBu4duSr73IA4Rzm+f1hFsKuxJ+8niplGD50WDFGvD7+g==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":12516},"main":"./index.ts","type":"module","module":"index.ts","shasum":"d32b3bbb5e8bd4c2782f368ab9d1501a3cdf890d","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:wsc-health-report":"bun ./example/wsc-health-report.ts","example:security-dashboard":"bun ./example/security-dashboard.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev.p@outlook.com"},"_integrity":"sha512-8fiJAiOusKeVTcBS7MS/oFGUzsli9R20i+lgGMnMoRx9G+lHYJuX34ewecuPgCyEfz6WKVvr8EPXN5joItCrqg==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/wscapi"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 WSCAPI bindings for Bun (FFI) on Windows.","directories":{},"sideEffects":false,"_nodeVersion":"26.3.0","dependencies":{"@bun-win32/core":"2.0.0"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest","@bun-win32/kernel32":"2.0.0"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/wscapi_2.0.0_1782436006548_0.6049800913087071","host":"s3://npm-registry-packages-npm-production"}},"2.0.1":{"author":"Stev Peifer <stev.p@outlook.com>","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dependencies":{"@bun-win32/core":"2.0.1"},"description":"Zero-dependency, zero-overhead Win32 WSCAPI bindings for Bun (FFI) on Windows.","devDependencies":{"@bun-win32/kernel32":"2.0.1","@types/bun":"latest"},"exports":{".":"./index.ts"},"license":"MIT","module":"index.ts","name":"@bun-win32/wscapi","peerDependencies":{"typescript":"^5"},"private":false,"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","repository":{"type":"git","url":"git://github.com/ObscuritySRL/bun-win32.git","directory":"packages/wscapi"},"type":"module","version":"2.0.1","main":"./index.ts","keywords":["bun","ffi","win32","windows","wscapi","bindings","typescript","dll"],"sideEffects":false,"engines":{"bun":">=1.1.0"},"scripts":{"example:security-dashboard":"bun ./example/security-dashboard.ts","example:wsc-health-report":"bun ./example/wsc-health-report.ts"},"_id":"@bun-win32/wscapi@2.0.1","_integrity":"sha512-qtV3jbmt+F36fODOxW4HqMtYeOMPKkBrq/OWA91gZ9N+EgXJwCKlHPB9K5l2R6qs06q00bqmfU8QHqtuooO6tQ==","_nodeVersion":"26.3.0","_npmVersion":"10.8.3","shasum":"6185b00f7b9f23885c197f675a16727db68ad70f","dist":{"integrity":"sha512-qtV3jbmt+F36fODOxW4HqMtYeOMPKkBrq/OWA91gZ9N+EgXJwCKlHPB9K5l2R6qs06q00bqmfU8QHqtuooO6tQ==","shasum":"6185b00f7b9f23885c197f675a16727db68ad70f","tarball":"https://registry.npmjs.org/@bun-win32/wscapi/-/wscapi-2.0.1.tgz","fileCount":6,"unpackedSize":12516,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCtBhiB1U+XdreguKipIPafdWWZvBZfU82T3YTG4bnWjQIgaiHD0eiuvCUiIvLrjgoV8O95tkElnuwPnXBj3XrNS8w="}]},"_npmUser":{"name":"obscuritysrl","email":"stev.p@outlook.com"},"directories":{},"maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/wscapi_2.0.1_1782438231794_0.03277637663263633"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-19T00:29:08.578Z","modified":"2026-06-26T01:43:52.069Z","1.0.0":"2026-05-19T00:29:08.798Z","2.0.0":"2026-06-26T01:06:46.725Z","2.0.1":"2026-06-26T01:43:51.962Z"},"bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"author":"Stev Peifer <stev.p@outlook.com>","license":"MIT","homepage":"https://github.com/ObscuritySRL/bun-win32#readme","keywords":["bun","ffi","win32","windows","wscapi","bindings","typescript","dll"],"repository":{"type":"git","url":"git://github.com/ObscuritySRL/bun-win32.git","directory":"packages/wscapi"},"description":"Zero-dependency, zero-overhead Win32 WSCAPI bindings for Bun (FFI) on Windows.","maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"readme":"# @bun-win32/wscapi\n\nZero-dependency, zero-overhead Win32 WSCAPI bindings for [Bun](https://bun.sh) on Windows.\n\n## Overview\n\n`@bun-win32/wscapi` exposes the `wscapi.dll` exports using [Bun](https://bun.sh)'s FFI. It provides a single class, `Wscapi`, which lazily binds native symbols on first use. You can optionally preload a subset or all symbols up-front via `Preload()`.\n\nThe Windows Security Center (WSC) API reports the aggregate health of the system's security provider categories — firewall, antivirus, automatic updates, UAC, internet settings, and the WSC service — and lets an app register for change notifications. It is the supported way to read security posture without parsing `Get-MpComputerStatus` output.\n\nThe bindings are strongly typed for a smooth DX in TypeScript.\n\n## Features\n\n- [Bun](https://bun.sh)-first ergonomics on Windows 10/11.\n- Direct FFI to `wscapi.dll` (Windows Security Center provider health, change notifications, antimalware URI).\n- In-source docs in `structs/Wscapi.ts` with links to Microsoft Docs.\n- Lazy binding on first call; optional eager preload (`Wscapi.Preload()`).\n- No wrapper overhead; calls map 1:1 to native APIs.\n- Strongly-typed Win32 aliases (see `types/Wscapi.ts`).\n\n## Requirements\n\n- [Bun](https://bun.sh) runtime\n- Windows 10 or later\n\n## Installation\n\n```sh\nbun add @bun-win32/wscapi\n```\n\n## Quick Start\n\n```ts\nimport Wscapi, { WSC_SECURITY_PROVIDER, WSC_SECURITY_PROVIDER_HEALTH } from '@bun-win32/wscapi';\n\nconst health = Buffer.alloc(4);\nconst hr = Wscapi.WscGetSecurityProviderHealth(WSC_SECURITY_PROVIDER.WSC_SECURITY_PROVIDER_ANTIVIRUS, health.ptr);\n\nconst code = health.readInt32LE(0);\nconsole.log('Antivirus:', WSC_SECURITY_PROVIDER_HEALTH[code], `(hr=${hr})`);\n// hr === 1 (S_FALSE) means the WSC service is not running.\n```\n\n> [!NOTE]\n> AI agents: see `AI.md` for the package binding contract and source-navigation guidance. It explains how to use the package without scanning the entire implementation.\n\n## Examples\n\nRun the included examples:\n\n```sh\nbun run example/security-dashboard.ts\nbun run example/wsc-health-report.ts\n```\n\n## Notes\n\n- Either rely on lazy binding or call `Wscapi.Preload()`.\n- `WscGetSecurityProviderHealth` returns `S_FALSE` (`1`) and forces `pHealth` to `POOR` if the WSC service is stopped.\n- As of Windows 10 1607, WSC tracks antivirus but not standalone antispyware.\n- Pair `WscRegisterForChanges` with `WscUnRegisterChanges`.\n- Windows only. Bun runtime required.\n- **SAL types & naming:** nullability is in the **type** — `Optional<T>` (formally optional, SAL `_*opt_`) and `Nullable<T>` (plain `[in]`/`[out]` the docs say can be NULL), the null sentinel derived from `T` (`null` for pointers `LP*`/`P*`, `0n` for handles/by-value addresses); direction is in the **parameter name** — `_out` (`_Out_`), `_in_out` (`_Inout_`), `_In_` bare. See `AI.md` and the repo `AGENTS.md`.\n","readmeFilename":"README.md"}