{"_id":"@bun-win32/rasapi32","_rev":"3-82f163d3852a4912699040d1463f5395","name":"@bun-win32/rasapi32","dist-tags":{"latest":"2.0.1"},"versions":{"1.0.0":{"name":"@bun-win32/rasapi32","version":"1.0.0","keywords":["bun","ffi","win32","windows","rasapi32","bindings","typescript","dll","ras","vpn","dial-up","phonebook","networking"],"author":"Stev Peifer <stev@bell.net>","license":"MIT","_id":"@bun-win32/rasapi32@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":"792bde3ca7116a0cd216de38af9bcb5a53d2f1fa","tarball":"https://registry.npmjs.org/@bun-win32/rasapi32/-/rasapi32-1.0.0.tgz","fileCount":6,"integrity":"sha512-vkII6PZuLCz9LX62sG0cQLgWgYRFtH++ClVxDJ0gKbnA2d82AaXjC4yYnILPs3g2A1D8ayyeN7L5KF3MLaHS5A==","signatures":[{"sig":"MEQCIDumH4VBIFZPYC5jm7USn4vO8YCpG8xeMZBLmM4gwMFSAiBwfYjzW0XsqOHPHOlawA5prqn1TvUdc5nKPRp2vFwKmw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":46138},"main":"./index.ts","type":"module","module":"index.ts","shasum":"792bde3ca7116a0cd216de38af9bcb5a53d2f1fa","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:dialup-screech":"bun ./example/dialup-screech.ts","example:ras-diagnostic":"bun ./example/ras-diagnostic.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev@bell.net"},"_integrity":"sha512-vkII6PZuLCz9LX62sG0cQLgWgYRFtH++ClVxDJ0gKbnA2d82AaXjC4yYnILPs3g2A1D8ayyeN7L5KF3MLaHS5A==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/rasapi32"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 RASAPI32 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/rasapi32_1.0.0_1779073015108_0.255793325438713","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@bun-win32/rasapi32","version":"2.0.0","keywords":["bun","ffi","win32","windows","rasapi32","bindings","typescript","dll","ras","vpn","dial-up","phonebook","networking"],"author":"Stev Peifer <stev.p@outlook.com>","license":"MIT","_id":"@bun-win32/rasapi32@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":"f9ce88e24e9b692ee05c32eba1a4bd3da13ec06e","tarball":"https://registry.npmjs.org/@bun-win32/rasapi32/-/rasapi32-2.0.0.tgz","fileCount":6,"integrity":"sha512-DZOpfLySfGUIUBORSWUntu+k50N3U2xWQSnccMDyHM2QZewdxrz0ZTGRQGi5Ux2fZmTrpfrdH111I8TiUpIMXw==","signatures":[{"sig":"MEUCIDYmZZjnVNrV/YTTc1lxbEbRyV50EHKlROMbA9xoLLeaAiEAyELisWZE57xPLpmt+f1T2sgon1OK+TzMBW0LqF6tPFI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":48795},"main":"./index.ts","type":"module","module":"index.ts","shasum":"f9ce88e24e9b692ee05c32eba1a4bd3da13ec06e","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:dialup-screech":"bun ./example/dialup-screech.ts","example:ras-diagnostic":"bun ./example/ras-diagnostic.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev.p@outlook.com"},"_integrity":"sha512-DZOpfLySfGUIUBORSWUntu+k50N3U2xWQSnccMDyHM2QZewdxrz0ZTGRQGi5Ux2fZmTrpfrdH111I8TiUpIMXw==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/rasapi32"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 RASAPI32 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/rasapi32_2.0.0_1782435498066_0.6737544201983172","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 RASAPI32 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/rasapi32","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/rasapi32"},"type":"module","version":"2.0.1","main":"./index.ts","keywords":["bun","ffi","win32","windows","rasapi32","bindings","typescript","dll","ras","vpn","dial-up","phonebook","networking"],"sideEffects":false,"engines":{"bun":">=1.1.0"},"scripts":{"example:dialup-screech":"bun ./example/dialup-screech.ts","example:ras-diagnostic":"bun ./example/ras-diagnostic.ts"},"_id":"@bun-win32/rasapi32@2.0.1","_integrity":"sha512-0MG6PN/a7fsFP8ocPxQj4OnOnznCM+bxOTLW5DVy9fApdg2AVpYxD6pOs5Lt6mBXA3AGiJydjtrHK4DoBI77XQ==","_nodeVersion":"26.3.0","_npmVersion":"10.8.3","shasum":"0f04ca40b71128d52e24819ef625c0099c7fc92b","dist":{"integrity":"sha512-0MG6PN/a7fsFP8ocPxQj4OnOnznCM+bxOTLW5DVy9fApdg2AVpYxD6pOs5Lt6mBXA3AGiJydjtrHK4DoBI77XQ==","shasum":"0f04ca40b71128d52e24819ef625c0099c7fc92b","tarball":"https://registry.npmjs.org/@bun-win32/rasapi32/-/rasapi32-2.0.1.tgz","fileCount":6,"unpackedSize":48795,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIFWL2Wuuz4vkboLzYuWeVf2js+jN/k2mlY9L3IQwOQ4UAiAGdrODS/ubyrUmYY1qyk+/Nph5nbWucF/ibwPjORUDhQ=="}]},"_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/rasapi32_2.0.1_1782438158366_0.6602680979305484"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-18T02:56:54.931Z","modified":"2026-06-26T01:42:38.663Z","1.0.0":"2026-05-18T02:56:55.250Z","2.0.0":"2026-06-26T00:58:18.256Z","2.0.1":"2026-06-26T01:42:38.533Z"},"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","rasapi32","bindings","typescript","dll","ras","vpn","dial-up","phonebook","networking"],"repository":{"type":"git","url":"git://github.com/ObscuritySRL/bun-win32.git","directory":"packages/rasapi32"},"description":"Zero-dependency, zero-overhead Win32 RASAPI32 bindings for Bun (FFI) on Windows.","maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"readme":"# @bun-win32/rasapi32\n\nZero-dependency, zero-overhead Win32 Rasapi32 bindings for [Bun](https://bun.sh) on Windows.\n\n## Overview\n\n`@bun-win32/rasapi32` exposes the `rasapi32.dll` exports using [Bun](https://bun.sh)'s FFI. It provides a single class, `Rasapi32`, which lazily binds native symbols on first use. You can optionally preload a subset or all symbols up-front via `Preload()`.\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 `rasapi32.dll` (RAS dial-up, VPN, phonebook entries, connection management, projection info, and statistics).\n- In-source docs in `structs/Rasapi32.ts` with links to Microsoft Docs.\n- Lazy binding on first call; optional eager preload (`Rasapi32.Preload()`).\n- No wrapper overhead; calls map 1:1 to native APIs.\n- Strongly-typed Win32 aliases (see `types/Rasapi32.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/rasapi32\n```\n\n## Quick Start\n\n```ts\nimport Rasapi32 from '@bun-win32/rasapi32';\n\n// Optionally bind a subset up-front\nRasapi32.Preload(['RasEnumConnectionsW', 'RasGetErrorStringW']);\n\n// How many RAS (dial-up/VPN) connections are active right now?\nconst cb = Buffer.alloc(4);\nconst count = Buffer.alloc(4);\n// First call with a NULL buffer: a return of 0 with count 0 means none active.\nRasapi32.RasEnumConnectionsW(null, cb.ptr, count.ptr);\nconsole.log('Active RAS connections: %d', count.readUInt32LE(0));\n\n// Translate a RAS error code (691 = bad username/password) to a message.\nconst msg = Buffer.alloc(512);\nRasapi32.RasGetErrorStringW(691, msg.ptr, 256);\nconsole.log(new TextDecoder('utf-16le').decode(msg).replace(/\\0.*$/, ''));\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:dialup-screech    # Animated retro dial-up handshake visualizer\nbun run example:ras-diagnostic    # Full RAS subsystem diagnostic report\n```\n\n## Notes\n\n- Either rely on lazy binding or call `Rasapi32.Preload()`.\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"}