Files: e6bb7dfe86f19f0188e093e016c11a70df79bf72 / 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