Files: 8cd3e3af7c391f083f5f83593a260f831c7083af / tools / injectTypes
456 bytesRaw
1 | #!/usr/bin/env node |
2 | const fs = require('fs') |
3 | const types = require('../customTypes') |
4 | |
5 | const typeinfoFile = process.argv[2] |
6 | const inputWasmFile = process.argv[3] |
7 | const outputWasmFile = process.argv[4] |
8 | |
9 | const typeinfo = JSON.parse(fs.readFileSync(typeinfoFile)) |
10 | const inputWasm = fs.readFileSync(inputWasmFile) |
11 | |
12 | const buf = types.encodeJSON(typeinfo) |
13 | const outputWasm = types.injectCustomSection(buf, inputWasm) |
14 | |
15 | fs.writeFileSync(outputWasmFile, outputWasm) |
16 |
Built with git-ssb-web