{"_id":"@alexaltea/keystone-js","name":"@alexaltea/keystone-js","dist-tags":{"latest":"0.9.2"},"versions":{"0.9.2":{"name":"@alexaltea/keystone-js","version":"0.9.2","description":"Keystone assembler framework port for JavaScript","author":{"name":"Alexandro Sanchez Bach","email":"alexaltea123@gmail.com"},"license":"GPL-2.0","homepage":"https://alexaltea.github.io/keystone.js/","keywords":["keystone","assembler","assembly","wasm","webassembly"],"repository":{"type":"git","url":"git+https://github.com/AlexAltea/keystone.js.git"},"main":"./dist/keystone.js","scripts":{"build":"python3 build.py","serve":"python3 -m http.server"},"bugs":{"url":"https://github.com/AlexAltea/keystone.js/issues"},"_id":"@alexaltea/keystone-js@0.9.2","gitHead":"7693b038edb6b3352937daeab39321a784fa9075","_nodeVersion":"20.5.1","_npmVersion":"10.3.0","dist":{"integrity":"sha512-nGyF752Xlz0vAOEZpjGYI1vrr38cQge7+KbPmX44bVNi849tb06WGPpHTTWxdCG7T+XfPjxFj+/K2S+mhRJauQ==","shasum":"f17c737372b61b0a2d817f075a6e695caa7b5199","tarball":"https://registry.npmjs.org/@alexaltea/keystone-js/-/keystone-js-0.9.2.tgz","fileCount":5,"unpackedSize":4417508,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIEr1QPEDIQZos1K9ijcP4AKhIp8DpRIZtIStwzuef5mcAiBhjQXsvsz7h0Pu+gYaHIxlrPK6HfRE+60cQnGxEKCrCA=="}]},"_npmUser":{"name":"alexaltea","email":"alexandro@phi.nz"},"directories":{},"maintainers":[{"name":"alexaltea","email":"alexandro@phi.nz"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/keystone-js_0.9.2_1781605784810_0.6430179831535063"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-16T10:29:44.671Z","0.9.2":"2026-06-16T10:29:45.063Z","modified":"2026-06-16T10:29:45.248Z"},"maintainers":[{"name":"alexaltea","email":"alexandro@phi.nz"}],"description":"Keystone assembler framework port for JavaScript","homepage":"https://alexaltea.github.io/keystone.js/","keywords":["keystone","assembler","assembly","wasm","webassembly"],"repository":{"type":"git","url":"git+https://github.com/AlexAltea/keystone.js.git"},"author":{"name":"Alexandro Sanchez Bach","email":"alexaltea123@gmail.com"},"bugs":{"url":"https://github.com/AlexAltea/keystone.js/issues"},"license":"GPL-2.0","readme":"Keystone.js\n===========\n\nPort of the [Keystone](https://github.com/keystone-engine/keystone) assembler framework for JavaScript/WASM. Powered by [Emscripten](https://github.com/emscripten-core/emscripten).\n\n**Requirements:** JavaScript environment with [WebAssembly](https://developer.mozilla.org/en-US/docs/WebAssembly) and [BigInt](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) support.\n\n**Notes:** _Keystone_ is a lightweight multi-architecture assembler framework originally developed by Nguyen Anh Quynh et al. and released under a dual GPLv2 and commercial license. More information about contributors and license terms can be found in the files `AUTHORS.TXT`, `CREDITS.TXT`, `COPYING`, `EXCEPTIONS-CLIENT` and  `LICENSE-COM.TXT` of the *keystone* submodule in this repository.\n\n## Installation\n\nTo add Keystone.js to your web application, include it with:\n\n```html\n<script src=\"keystone.js\"></script>\n```\n\nor install it with the NPM command:\n\n```bash\nnpm install @alexaltea/keystone-js\n```\n\n## Usage\n\n```javascript\n// Input: Assembly\nconst assembly =\n   `inc   rax\n    call  0x10040\n    mov   rax, qword ptr[rdx + 4]\n    sub   esp, 0x100\n    pop   rbx`;\n\nMKeystone().then((ks) => {\n    // Initialize the encoder\n    var a = new ks.Keystone(ks.ARCH_X86, ks.MODE_64);\n\n    // Choose preferred syntax\n    a.option(ks.OPT_SYNTAX, ks.OPT_SYNTAX_INTEL);\n\n    // Assemble instructions\n    var result = a.asm(assembly);\n    console.log(result.failed); // false\n    console.log(result.count); // 5\n    console.log(result.mc); // Uint8Array([0x48, 0xFF, 0xC0, ...])\n\n    // Delete encoder\n    a.close();\n});\n```\n\n## Building\n\nTo build the Keystone.js library:\n\n1. Clone this repository including its submodules:\n    ```bash\n    git clone --recursive https://github.com/AlexAltea/keystone.js\n    ```\n\n2. Install the latest [Python 3.x](https://www.python.org/downloads/), [CMake](http://www.cmake.org/download/) and the [Emscripten SDK](https://emscripten.org/docs/getting_started/downloads.html). Follow the corresponding instructions and make sure all environment variables are configured correctly.\n\n3. Run the build script:\n   ```bash\n   python3 build.py\n   ```\n\nBuild artifacts will be saved to [`dist`](./dist/).\n\n> [!TIP]\n> Pass architecture names to produce a smaller, single-architecture bundle (e.g. `python3 build.py x86`), or `python3 build.py --release` to build every variant.\n","readmeFilename":"README.md","_rev":"1-1fd2c8b12006baa0b3c8be26652e15f7"}