{"_id":"@dolphindepot/bnr","_rev":"3-2153449d1c3e2d72d5ebe22ffb3b511a","name":"@dolphindepot/bnr","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.0":{"name":"@dolphindepot/bnr","version":"0.1.0","_id":"@dolphindepot/bnr@0.1.0","maintainers":[{"name":"webhdx","email":"webhdx@gmail.com"}],"dist":{"shasum":"a094a8912370e134f4e40a2749cd090117b8881e","tarball":"https://registry.npmjs.org/@dolphindepot/bnr/-/bnr-0.1.0.tgz","fileCount":5,"integrity":"sha512-KAG+QRmrQ5erjssRS85g9Tgjq8GDZ7sv7HQjc9PZfaRReL5g/5IJFH7gt/0575ul/fXn8k0q8KrW40eAYAgwbw==","signatures":[{"sig":"MEQCIDTjKx+InycPvE9lKZ5QHA2Auv0BXWAnrQdZNYBgj087AiBmc+ntW5y9RCt7oPrxgwAah/0D4ZQNt9ZKWWgJ+Z6AVA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":16179},"main":"./dist/index.mjs","type":"module","types":"./dist/index.d.mts","exports":{".":{"types":"./dist/index.d.mts","import":"./dist/index.mjs"}},"gitHead":"54bbb5469542d8781074c29fe1ae7621b20fc9a9","scripts":{"test":"vitest run","build":"tsdown","format":"prettier --write 'src/**/*.ts' 'tests/**/*.ts'","typecheck":"tsc --noEmit","test:watch":"vitest","format:check":"prettier --check 'src/**/*.ts' 'tests/**/*.ts'"},"_npmUser":{"name":"webhdx","email":"webhdx@gmail.com"},"_npmVersion":"10.9.3","description":"Encode and decode Nintendo GameCube BNR1/BNR2 (opening.bnr) files","directories":{},"_nodeVersion":"22.20.0","_hasShrinkwrap":false,"devDependencies":{"tsdown":"^0","vitest":"^4","prettier":"^3","typescript":"^6"},"_npmOperationalInternal":{"tmp":"tmp/bnr_0.1.0_1774464060644_0.6940338071655778","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@dolphindepot/bnr","version":"0.1.1","_id":"@dolphindepot/bnr@0.1.1","maintainers":[{"name":"webhdx","email":"webhdx@gmail.com"}],"homepage":"https://github.com/DolphinDepot/bnr-ts#readme","bugs":{"url":"https://github.com/DolphinDepot/bnr-ts/issues"},"dist":{"shasum":"8d0c9a6afcf5dfa2331c4fa8cfc941e7993fbdda","tarball":"https://registry.npmjs.org/@dolphindepot/bnr/-/bnr-0.1.1.tgz","fileCount":5,"integrity":"sha512-4LusM9x0nXjwil1huG7FExfmOJzzl4wSIgQ5Ox8ZqsPoEs7H1yCk0ZYcVtXB2oKIyFNuQoJ5h9bKRobFghsYHw==","signatures":[{"sig":"MEYCIQCLztKwrMEBSACZi5hRYYafGs0O9H8JNZt06j5hhXj1zAIhANmbHlJbbfoYb8IqJGH7Yn1bpnRnmXSQmNsUNSeRolZT","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@dolphindepot%2fbnr@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":16281},"main":"./dist/index.mjs","type":"module","types":"./dist/index.d.mts","exports":{".":{"types":"./dist/index.d.mts","import":"./dist/index.mjs"}},"gitHead":"bb4961130180add5e857c6cfc3d9fe64f147c141","scripts":{"test":"vitest run","build":"tsdown","format":"prettier --write 'src/**/*.ts' 'tests/**/*.ts'","typecheck":"tsc --noEmit","test:watch":"vitest","format:check":"prettier --check 'src/**/*.ts' 'tests/**/*.ts'"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:731093e6-7b58-4b7d-873d-26710b34342b"}},"repository":{"url":"git+https://github.com/DolphinDepot/bnr-ts.git","type":"git"},"_npmVersion":"11.11.1","description":"Encode and decode Nintendo GameCube BNR1/BNR2 (opening.bnr) files","directories":{},"_nodeVersion":"25.8.2","_hasShrinkwrap":false,"devDependencies":{"tsdown":"^0","vitest":"^4","prettier":"^3","typescript":"^6"},"_npmOperationalInternal":{"tmp":"tmp/bnr_0.1.1_1774464883996_0.6043155649444607","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@dolphindepot/bnr","version":"0.1.2","description":"Encode and decode Nintendo GameCube BNR1/BNR2 (opening.bnr) files","type":"module","main":"./dist/index.mjs","types":"./dist/index.d.mts","exports":{".":{"import":"./dist/index.mjs","types":"./dist/index.d.mts"}},"repository":{"type":"git","url":"git+https://github.com/DolphinDepot/bnr-ts.git"},"scripts":{"build":"tsdown","test":"vitest run","test:watch":"vitest","typecheck":"tsc --noEmit","format":"prettier --write 'src/**/*.ts' 'tests/**/*.ts'","format:check":"prettier --check 'src/**/*.ts' 'tests/**/*.ts'"},"devDependencies":{"prettier":"^3","tsdown":"^0","typescript":"^6","vitest":"^4"},"gitHead":"5a1f34c5b1ac2b95a67b3868a49af2b3e646d8d7","_id":"@dolphindepot/bnr@0.1.2","bugs":{"url":"https://github.com/DolphinDepot/bnr-ts/issues"},"homepage":"https://github.com/DolphinDepot/bnr-ts#readme","_nodeVersion":"25.8.2","_npmVersion":"11.11.1","dist":{"integrity":"sha512-/eP9fVaA2cRucYCan6qcd7aIqot4lDNIpQr6A6AGReaF2qkFk5WUgvXZ8g6E2x7b3p8aOlPGUu5vE7iBPuHsvw==","shasum":"967a9abe1c98b6a9bb5cac2aee8e62f6a24ebd5e","tarball":"https://registry.npmjs.org/@dolphindepot/bnr/-/bnr-0.1.2.tgz","fileCount":5,"unpackedSize":16268,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@dolphindepot%2fbnr@0.1.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCTMNPc45YiUXXLOtW9UzgS3o+lhxt5rLDH1lX6KoAG4QIgRpgpq3rARiwEqYHgLgC3GyiMZID+BpljH5kvszcyCVM="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:731093e6-7b58-4b7d-873d-26710b34342b"}},"directories":{},"maintainers":[{"name":"webhdx","email":"webhdx@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/bnr_0.1.2_1774467089926_0.12903127324410768"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-25T18:41:00.530Z","modified":"2026-03-25T19:31:30.410Z","0.1.0":"2026-03-25T18:41:00.794Z","0.1.1":"2026-03-25T18:54:44.136Z","0.1.2":"2026-03-25T19:31:30.057Z"},"bugs":{"url":"https://github.com/DolphinDepot/bnr-ts/issues"},"homepage":"https://github.com/DolphinDepot/bnr-ts#readme","repository":{"type":"git","url":"git+https://github.com/DolphinDepot/bnr-ts.git"},"description":"Encode and decode Nintendo GameCube BNR1/BNR2 (opening.bnr) files","maintainers":[{"name":"webhdx","email":"webhdx@gmail.com"}],"readme":"# @dolphindepot/bnr\n\nEncode and decode Nintendo GameCube BNR1/BNR2 (`opening.bnr`) files.\n\n- Zero dependencies\n- Works in browsers, Node.js, and Cloudflare Workers\n- Full support for BNR1 (US/JP) and BNR2 (PAL/Europe, 6 languages)\n- RGB5A3 pixel format with GX 4x4 tile encoding\n- Shift-JIS text encoding/decoding\n\n## Install\n\n```bash\nnpm install @dolphindepot/bnr\n```\n\n## Usage\n\n### Decode\n\n```typescript\nimport { decode } from \"@dolphindepot/bnr\";\n\nconst bnr = decode(arrayBuffer);\n\nif (bnr.type === \"BNR1\") {\n    console.log(bnr.text.gameTitle);\n} else {\n    // BNR2 — 6 language blocks\n    console.log(bnr.texts[0].gameTitle); // English\n}\n\n// bnr.image.pixels is RGBA data (96x32, 12288 bytes)\n// Ready to draw on a <canvas> via ImageData\n```\n\n### Encode\n\n```typescript\nimport { encode } from \"@dolphindepot/bnr\";\n\nconst binary = encode({\n    type: \"BNR1\",\n    image: rgbaPixels, // Uint8Array, 96x32x4 = 12288 bytes\n    text: {\n        gameNameShort: \"My Game\",\n        developerNameShort: \"Dev\",\n        gameTitle: \"My Game - Full Title\",\n        developerName: \"Developer Name\",\n        description: \"A homebrew GameCube game.\",\n    },\n});\n\n// binary is a Uint8Array — save as opening.bnr\n```\n\n### BNR2 (multi-language)\n\n```typescript\nimport { encode, BnrLanguage } from \"@dolphindepot/bnr\";\n\nconst texts = [\n    { gameNameShort: \"My Game\", ... },    // English\n    { gameNameShort: \"Mein Spiel\", ... }, // German\n    { gameNameShort: \"Mon Jeu\", ... },    // French\n    { gameNameShort: \"Mi Juego\", ... },   // Spanish\n    { gameNameShort: \"Il Mio Gioco\", ... }, // Italian\n    { gameNameShort: \"Mijn Spel\", ... },  // Dutch\n];\n\nconst binary = encode({ type: \"BNR2\", image: rgbaPixels, texts });\n```\n\n## Image format\n\nThe library works with raw RGBA pixel data (`Uint8Array` of 12288 bytes for a 96x32 image). To convert from PNG/JPEG:\n\n**Browser (Canvas API):**\n\n```typescript\nconst img = new Image();\nimg.src = URL.createObjectURL(file);\nawait img.decode();\n\nconst canvas = new OffscreenCanvas(96, 32);\nconst ctx = canvas.getContext(\"2d\")!;\nctx.drawImage(img, 0, 0, 96, 32);\nconst rgba = new Uint8Array(ctx.getImageData(0, 0, 96, 32).data);\n```\n\n## BNR format reference\n\n| | BNR1 (US/JP) | BNR2 (PAL/Europe) |\n|---|---|---|\n| File size | 6496 bytes | 8096 bytes |\n| Image | 96x32 px, RGB5A3 | 96x32 px, RGB5A3 |\n| Languages | 1 | 6 (EN, DE, FR, ES, IT, NL) |\n| Text encoding | Shift-JIS | Shift-JIS |\n\n## License\n\nMIT\n","readmeFilename":"README.md"}