├── .gitignore ├── LICENSE ├── README.md ├── install.sh └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | binaryen 3 | wabt 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017 Mathias Buus 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # webassembly-binary-toolkit 2 | 3 | The WebAssembly Binary toolkit installable through npm 4 | 5 | ``` sh 6 | npm install -g webassembly-binary-toolkit 7 | ``` 8 | 9 | Will download and compile the WebAssembly tools from https://github.com/WebAssembly/wabt and https://github.com/WebAssembly/binaryen 10 | 11 | Requires git, make and cmake to be installed. 12 | 13 | After installing you'll be able to use all the WASM tools directly from you command line 14 | 15 | ``` sh 16 | wat2wasm example.wat -o example.wasm 17 | ``` 18 | 19 | See the repos for more options. 20 | 21 | ## See also 22 | 23 | * [wat2js](https://github.com/mafintosh/wat2js) - Compile .wat files to common js modules. 24 | 25 | ## License 26 | 27 | MIT 28 | -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | if ! (which cmake && which git && which make) >/dev/null 2>/dev/null; then 2 | echo cmake, git, make required 3 | exit 1 4 | fi 5 | 6 | rm -rf wabt 7 | git clone --recursive https://github.com/WebAssembly/wabt 8 | 9 | rm -rf binaryen 10 | git clone https://github.com/WebAssembly/binaryen 11 | 12 | cd wabt 13 | cmake . && make 14 | cd .. 15 | 16 | cd binaryen 17 | cmake . && make 18 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "webassembly-binary-toolkit", 3 | "version": "2.0.0", 4 | "description": "The WebAssembly Binary toolkit installable through npm", 5 | "main": "index.js", 6 | "scripts": { 7 | "preinstall": "./install.sh" 8 | }, 9 | "dependencies": {}, 10 | "devDependencies": {}, 11 | "repository": { 12 | "type": "git", 13 | "url": "https://github.com/mafintosh/webassembly-binary-toolkit.git" 14 | }, 15 | "bin": { 16 | "wat2wasm": "wabt/bin/wat2wasm", 17 | "wasm2wat": "wabt/bin/wasm2wat", 18 | "wasm-objdump": "wabt/bin/wasm-objdump", 19 | "wasm-interp": "wabt/bin/wasm-interp", 20 | "wat-desugar": "wabt/bin/wat-desugar", 21 | "wasm-link": "wabt/bin/wasm-link", 22 | "wasm-shell": "binaryen/bin/wasm-shell", 23 | "wasm-as": "binaryen/bin/wasm-as", 24 | "wasm-dis": "binaryen/bin/wasm-dis", 25 | "wasm-opt": "binaryen/bin/wasm-opt", 26 | "asm2wasm": "binaryen/bin/asm2wasm", 27 | "s2wasm": "binaryen/bin/s2wasm" 28 | }, 29 | "author": "Mathias Buus (@mafintosh)", 30 | "license": "MIT", 31 | "bugs": { 32 | "url": "https://github.com/mafintosh/webassembly-binary-toolkit/issues" 33 | }, 34 | "homepage": "https://github.com/mafintosh/webassembly-binary-toolkit" 35 | } 36 | --------------------------------------------------------------------------------