git ssb

0+

wanderer🌟 / js-primea-hypervisor



Tree: 192e8e23310b0b99e63703b7d840090c2b55ddfb

Files: 192e8e23310b0b99e63703b7d840090c2b55ddfb / tools / injectTypes

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

Built with git-ssb-web