{"_id":"@bun-win32/normaliz","_rev":"3-e290a31487e77c5d13a4afef5969b5b9","name":"@bun-win32/normaliz","dist-tags":{"latest":"2.0.1"},"versions":{"1.0.0":{"name":"@bun-win32/normaliz","version":"1.0.0","keywords":["bun","ffi","win32","windows","normaliz","bindings","typescript","dll"],"author":"Stev Peifer <stev@bell.net>","license":"MIT","_id":"@bun-win32/normaliz@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":"a69d07bc449701574663b573cf66b17c1aa6793d","tarball":"https://registry.npmjs.org/@bun-win32/normaliz/-/normaliz-1.0.0.tgz","fileCount":6,"integrity":"sha512-/9+W0MkqtZ0Ml8Z7hJ5gwku5B5Sj4jp6SVwRTQyEypU5EWQC+6sOisJ1vZFNB/vtYcam6JOA4FAAwft2MTpWUA==","signatures":[{"sig":"MEUCIHAM7UjrWYvKv6+kr/5o7la4uZmIfWNeqPt++n845cnDAiEAwgflWI89qvCJc0cZTd4F3Vx+rov/f9sbLIaRXgOr6OE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":10346},"main":"./index.ts","type":"module","module":"index.ts","shasum":"a69d07bc449701574663b573cf66b17c1aa6793d","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:normalization-audit":"bun ./example/normalization-audit.ts","example:address-bar-pipeline":"bun ./example/address-bar-pipeline.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev@bell.net"},"_integrity":"sha512-/9+W0MkqtZ0Ml8Z7hJ5gwku5B5Sj4jp6SVwRTQyEypU5EWQC+6sOisJ1vZFNB/vtYcam6JOA4FAAwft2MTpWUA==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/normaliz"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 NORMALIZ 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"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/normaliz_1.0.0_1775784246073_0.9282370511595897","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@bun-win32/normaliz","version":"2.0.0","keywords":["bun","ffi","win32","windows","normaliz","bindings","typescript","dll"],"author":"Stev Peifer <stev.p@outlook.com>","license":"MIT","_id":"@bun-win32/normaliz@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":"ed2fd8b60d462e06624a4828334309bdb4a00bc0","tarball":"https://registry.npmjs.org/@bun-win32/normaliz/-/normaliz-2.0.0.tgz","fileCount":6,"integrity":"sha512-8UQDFV9ME4HlhtSU8WTuB7cFDjUR3dHDSQcA2+P5w7/GeoUIxIyF+YZKE/qHxLlpXI4T3/Ed9QzelsnHn3k3gw==","signatures":[{"sig":"MEUCIDHCweaYySniJtaDj+JsCygnMZYeosz6wP80oHBylDc4AiEA3en+1scp1/KVPKiI7a/3TzMZsb135HMzd6g2X+mGF8A=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":11498},"main":"./index.ts","type":"module","module":"index.ts","shasum":"ed2fd8b60d462e06624a4828334309bdb4a00bc0","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:normalization-audit":"bun ./example/normalization-audit.ts","example:address-bar-pipeline":"bun ./example/address-bar-pipeline.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev.p@outlook.com"},"_integrity":"sha512-8UQDFV9ME4HlhtSU8WTuB7cFDjUR3dHDSQcA2+P5w7/GeoUIxIyF+YZKE/qHxLlpXI4T3/Ed9QzelsnHn3k3gw==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/normaliz"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 NORMALIZ 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"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/normaliz_2.0.0_1782435479806_0.566569102975313","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 NORMALIZ bindings for Bun (FFI) on Windows.","devDependencies":{"@types/bun":"latest"},"exports":{".":"./index.ts"},"license":"MIT","module":"index.ts","name":"@bun-win32/normaliz","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/normaliz"},"type":"module","version":"2.0.1","main":"./index.ts","keywords":["bun","ffi","win32","windows","normaliz","bindings","typescript","dll"],"sideEffects":false,"engines":{"bun":">=1.1.0"},"scripts":{"example:address-bar-pipeline":"bun ./example/address-bar-pipeline.ts","example:normalization-audit":"bun ./example/normalization-audit.ts"},"_id":"@bun-win32/normaliz@2.0.1","_integrity":"sha512-PY2DEkVh7hz8ygR+vlEsT6v3+LHLa8DLNKKVx3Ds1s244BT3Tdc91vmF97ru6MBudl9r5bSSm9atlAmpcm900A==","_nodeVersion":"26.3.0","_npmVersion":"10.8.3","shasum":"36df4e1435277f20d3e260b99123f7a43271e14a","dist":{"integrity":"sha512-PY2DEkVh7hz8ygR+vlEsT6v3+LHLa8DLNKKVx3Ds1s244BT3Tdc91vmF97ru6MBudl9r5bSSm9atlAmpcm900A==","shasum":"36df4e1435277f20d3e260b99123f7a43271e14a","tarball":"https://registry.npmjs.org/@bun-win32/normaliz/-/normaliz-2.0.1.tgz","fileCount":6,"unpackedSize":11498,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIE8EsTZMDX5kWv8qd7YCVyskpBT3da3NVb9SHU7ToYCDAiBpHhpgmYUSTVW56/0vQHIPUT/APl8hz2EuuoVuwVK0NA=="}]},"_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/normaliz_2.0.1_1782438139595_0.5495504974584653"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-10T01:24:05.991Z","modified":"2026-06-26T01:42:19.857Z","1.0.0":"2026-04-10T01:24:06.221Z","2.0.0":"2026-06-26T00:57:59.938Z","2.0.1":"2026-06-26T01:42:19.746Z"},"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","normaliz","bindings","typescript","dll"],"repository":{"type":"git","url":"git://github.com/ObscuritySRL/bun-win32.git","directory":"packages/normaliz"},"description":"Zero-dependency, zero-overhead Win32 NORMALIZ bindings for Bun (FFI) on Windows.","maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"readme":"# @bun-win32/normaliz\n\nZero-dependency, zero-overhead Win32 Normaliz bindings for [Bun](https://bun.sh) on Windows.\n\n## Overview\n\n`@bun-win32/normaliz` exposes the `normaliz.dll` exports using [Bun](https://bun.sh)'s FFI. It provides a single class, `Normaliz`, 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 `normaliz.dll` (internationalized domain names, Nameprep, and Unicode normalization).\n- In-source docs in `structs/Normaliz.ts` with links to Microsoft Docs.\n- Lazy binding on first call; optional eager preload (`Normaliz.Preload()`).\n- No wrapper overhead; calls map 1:1 to native APIs.\n- Strongly-typed Win32 aliases (see `types/Normaliz.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/normaliz\n```\n\n## Quick Start\n\n```ts\nimport Normaliz, { NormalizationForm } from '@bun-win32/normaliz';\n\nconst source = Buffer.from('e\\u0301\\0', 'utf16le');\nconst bufferLengthEstimate = Normaliz.NormalizeString(NormalizationForm.NormalizationC, source.ptr!, -1, null, 0);\n\nif (bufferLengthEstimate <= 0) {\n  throw new Error('NormalizeString sizing call failed');\n}\n\nconst destination = Buffer.alloc(bufferLengthEstimate * 2);\nconst writtenLength = Normaliz.NormalizeString(NormalizationForm.NormalizationC, source.ptr!, -1, destination.ptr!, bufferLengthEstimate);\n\nif (writtenLength <= 0) {\n  throw new Error('NormalizeString failed');\n}\n\nconst normalized = destination.toString('utf16le').replace(/\\0.*$/, '');\nconsole.log(normalized); // \"é\"\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:address-bar-pipeline\nbun run example:normalization-audit\n```\n\n## Notes\n\n- Either rely on lazy binding or call `Normaliz.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"}