{"_id":"@clearvisiongg/nodempq","name":"@clearvisiongg/nodempq","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@clearvisiongg/nodempq","version":"1.0.0","main":"example.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","start":"node example"},"keywords":[],"author":{"name":"XPZ2K15"},"license":"ISC","description":"A tiny, dependency‑light Node.js library that lets you **open, list and extract files** from Blizzard‐style MPQ archives (as used by Diablo II and other classic titles).","dependencies":{"node-pkware":"^5.1.0","wav":"^1.0.2"},"_id":"@clearvisiongg/nodempq@1.0.0","gitHead":"d5b5d3aac448b9517f5c2d3d74273d4976f40cdf","_nodeVersion":"20.18.2","_npmVersion":"10.8.2","dist":{"integrity":"sha512-iOFU3paRrhxeeMIcJnhQTxaz/xAnF+85hbaJOzk29YfRatw9V6fl85Lci11GvMisLlRd6azkHk22l206/Jt52w==","shasum":"8ed8d2b0ea406ff01a160590672a77f189731728","tarball":"https://registry.npmjs.org/@clearvisiongg/nodempq/-/nodempq-1.0.0.tgz","fileCount":10,"unpackedSize":31989,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIC9qGZ1KTlQ2MLlxxQHxmWBm7+A/iM58nKp5YamTgMGdAiEAr4r2ZQuP6yIRNWgyUxLq7u/Obwzg5lu5P1Imc4LY6kM="}]},"_npmUser":{"name":"clearvisiongg","email":"chrispayne282@gmail.com"},"directories":{},"maintainers":[{"name":"clearvisiongg","email":"chrispayne282@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/nodempq_1.0.0_1749838029683_0.8071421749526007"},"_hasShrinkwrap":false}},"time":{"created":"2025-06-13T18:07:09.600Z","1.0.0":"2025-06-13T18:07:09.910Z","modified":"2025-06-13T18:07:10.166Z"},"maintainers":[{"name":"clearvisiongg","email":"chrispayne282@gmail.com"}],"description":"A tiny, dependency‑light Node.js library that lets you **open, list and extract files** from Blizzard‐style MPQ archives (as used by Diablo II and other classic titles).","keywords":[],"author":{"name":"XPZ2K15"},"license":"ISC","readme":"# D2Web MPQ Reader / Extractor\n\nA tiny, dependency‑light Node.js library that lets you **open, list and extract files** from Blizzard‐style MPQ archives (as used by Diablo II and other classic titles).\n\n> **Status:** experimental – APIs may change while things settle. Tested with Diablo II 1.14d MPQs\n\n---\n\n## ✨ Features\n\n- Open an archive header‑only (`MPQ.New`) **or** fully parse the hash / block tables (`MPQ.FromFile`).\n- List every file inside the archive with `mpq.listfile()`.\n- Read whole files into a `Buffer` (`mpq.readFile`) or lazily as a stream (`mpq.readFileStream`).\n- Transparent handling of –\n  - PKWARE DCL (\"explode\")\n  - zlib / deflate\n  - ADPCM WAV audio blocks\n  - Blizzard file encryption / sector tables\n- Zero native addons – pure JS.\n\n---\n\n## 📁 Project Layout\n\n```\nnodempq/\n├─ mpq/              ← Core MPQ parsers & helpers\n│  ├─ block.js\n│  ├─ crypto.js\n│  ├─ hash.js\n│  ├─ header.js\n│  └─ mpq.js\n│\n├─ stream/           ← Low‑level sector & convenience data streams\n│  ├─ stream.js\n│  └─ data_stream.js\n│\n├─ example.js        ← Quick demo: list archive & read a file\n├─ package.json\n└─ package‑lock.json\n```\n\nIf you want to consume this as a package, treat ``as the public entry point (or re‑export it from`src/index.js` in your own project).\n\n---\n\n## 🚀 Quick Start\n\n```bash\n# 1. install (local dev checkout)\n$ git clone https://github.com/XPZ2k15/nodempq.git && cd D2WEB\n$ npm install\n\n# 2. run the demo (edit the path to your .mpq)\n$ node example \"C:/Program Files (x86)/Diablo II/d2data.mpq\"\n```\n\n### Programmatic usage\n\n```js\nimport { MPQ } from './mpq/mpq.js'; // or:  import { MPQ } from \"d2web\";\n\nconst mpq = await MPQ.FromFile('d2data.mpq');\n\nconsole.log(await mpq.listfile()); // → array of file names\n\nconst buf = await mpq.readFile('data/global/excel/Arena.txt');\nconsole.log(buf.toString());\n\n// Streaming read (fs‑style)\nconst ds = await mpq.readFileStream('data/global/AnimData.D2');\nconst chunk = Buffer.alloc(1024);\nconst n = await ds.read(chunk);\nconsole.log('first KB:', chunk.slice(0, n));\n```\n\n---\n\n## 🛠️ Scripts\n\n| NPM script      | What it does                                  |\n| --------------- | --------------------------------------------- |\n| `npm run start` | Runs the Example: Please provide your own MPQ |\n\n---\n\n### Output Example\n\n```terminal\nArchive size: 269191614\nFiles in archive: [\n  'binkw32.dll',\n  'Bnclient.dll',\n  'D2Client.dll',\n  'D2CMP.dll',\n  'D2Common.dll',\n  'D2DDraw.dll',\n  'D2Direct3D.dll',\n  'D2Game.dll',\n  'D2Gdi.dll',\n  'D2gfx.dll',\n  'D2Glide.dll',\n  'D2Lang.dll',\n  'D2Launch.dll',\n  'D2MCPClient.dll',\n  'D2Multi.dll',\n  'D2Net.dll',\n  'D2sound.dll',\n  'D2VidTst.exe',\n  'D2Win.dll',\n  'data\\\\global\\\\AnimData.D2',\n  'data\\\\global\\\\chars_cof.d2',\n  'data\\\\global\\\\cmncof_a1.d2',\n  'data\\\\global\\\\cmncof_a2.d2',\n  'data\\\\global\\\\cmncof_a3.d2',\n  'data\\\\global\\\\cmncof_a4.d2',\n  'data\\\\global\\\\cmncof_a5.d2',\n  'data\\\\global\\\\cmncof_a6.d2',\n  'data\\\\global\\\\cmncof_a7.d2',\n  'data\\\\global\\\\excel\\\\Aiparms.txt',\n  'data\\\\global\\\\excel\\\\Arena.txt',\n  'data\\\\global\\\\excel\\\\armor.txt',\n  'data\\\\global\\\\excel\\\\ArmType.txt',\n  'data\\\\global\\\\excel\\\\AutoMap.txt',\n  'data\\\\global\\\\excel\\\\belts.txt',\n  'data\\\\global\\\\excel\\\\books.txt',\n  'data\\\\global\\\\excel\\\\charstats.txt',\n  'data\\\\global\\\\excel\\\\CharTemplate.txt',\n  'data\\\\global\\\\excel\\\\Composit.txt',\n  'data\\\\global\\\\excel\\\\difficultylevels.txt',\n  'data\\\\global\\\\excel\\\\experience.txt',\n  'data\\\\global\\\\excel\\\\gamble.txt',\n  'data\\\\global\\\\excel\\\\gems.txt',\n  'data\\\\global\\\\excel\\\\inventory.txt',\n  'data\\\\global\\\\excel\\\\itemratio.txt',\n  'data\\\\global\\\\excel\\\\ItemStatCost.txt',\n  'data\\\\global\\\\excel\\\\Levels.txt',\n  'data\\\\global\\\\excel\\\\lowqualityitems.txt',\n  'data\\\\global\\\\excel\\\\LvlMaze.txt',\n  'data\\\\global\\\\excel\\\\LvlPrest.txt',\n  'data\\\\global\\\\excel\\\\LvlSub.txt',\n  'data\\\\global\\\\excel\\\\LvlTypes.txt',\n  'data\\\\global\\\\excel\\\\LvlWarp.txt',\n  'data\\\\global\\\\excel\\\\MagicPrefix.txt',\n  'data\\\\global\\\\excel\\\\MagicSuffix.txt',\n  'data\\\\global\\\\excel\\\\misc.txt',\n  'data\\\\global\\\\excel\\\\Missiles.txt',\n  'data\\\\global\\\\excel\\\\MonItemPercent.txt',\n  'data\\\\global\\\\excel\\\\MonMode.txt',\n  'data\\\\global\\\\excel\\\\MonName.txt',\n  'data\\\\global\\\\excel\\\\monstats.txt',\n  'data\\\\global\\\\excel\\\\MonType.txt',\n  'data\\\\global\\\\excel\\\\objects.txt',\n  'data\\\\global\\\\excel\\\\objgroup.txt',\n  'data\\\\global\\\\excel\\\\ObjMode.txt',\n  'data\\\\global\\\\excel\\\\ObjType.txt',\n  'data\\\\global\\\\excel\\\\Overlay.txt',\n  'data\\\\global\\\\excel\\\\PlrMode.txt',\n  'data\\\\global\\\\excel\\\\PlrType.txt',\n  'data\\\\global\\\\excel\\\\qualityitems.txt',\n  'data\\\\global\\\\excel\\\\RarePrefix.txt',\n  'data\\\\global\\\\excel\\\\RareSuffix.txt',\n  'data\\\\global\\\\excel\\\\SetItems.txt',\n  'data\\\\global\\\\excel\\\\shrines.txt',\n  'data\\\\global\\\\excel\\\\skills.txt',\n  'data\\\\global\\\\excel\\\\SoundEnviron.txt',\n  'data\\\\global\\\\excel\\\\Sounds.txt',\n  'data\\\\global\\\\excel\\\\SuperUniques.txt',\n  'data\\\\global\\\\excel\\\\TreasureClass.txt',\n  'data\\\\global\\\\excel\\\\UniqueAppellation.txt',\n  'data\\\\global\\\\excel\\\\UniqueItems.txt',\n  'data\\\\global\\\\excel\\\\UniquePrefix.txt',\n  'data\\\\global\\\\excel\\\\UniqueSuffix.txt',\n  'data\\\\global\\\\excel\\\\UniqueTitle.txt',\n  'data\\\\global\\\\excel\\\\weapons.txt',\n  'data\\\\global\\\\ExpField.D2',\n  'data\\\\global\\\\items\\\\fkpskp.DC6',\n  'data\\\\global\\\\items\\\\flp2ax.dc6',\n  'data\\\\global\\\\items\\\\flpaar.dc6',\n  'data\\\\global\\\\items\\\\flpaxe.DC6',\n  'data\\\\global\\\\items\\\\flpbar.DC6',\n  'data\\\\global\\\\items\\\\flpbbk.DC6',\n  'data\\\\global\\\\items\\\\flpbkf.dc6',\n  'data\\\\global\\\\items\\\\flpbld.dc6',\n  'data\\\\global\\\\items\\\\flpblt.DC6',\n  'data\\\\global\\\\items\\\\flpblu.DC6',\n  ... 10742 more items\n]\nContents: Arena Suicide PlayerKill      PlayerKillPercent       MonsterKill     PlayerDeath     PlayerDeathPercent      MonsterDeath\nDeathmatch      -6      2       10      1       -2      -10     -1\n\nFirst 128 bytes: <Buffer 41 72 65 6e 61 09 53 75 69 63 69 64 65 09 50 6c 61 79 65 72 4b 69 6c 6c 09 50 6c 61 79 65 72 4b 69 6c 6c 50 65 72 63 65 6e 74 09 4d 6f 6e 73 74 65 72 ... 78 more bytes>\n```\n\n## 📝 License\n\nMIT © 2025 XPZ2K15\n","readmeFilename":"readme.md","_rev":"1-d5fdd49874ffbb63cb3308c2ec78e340"}