git ssb

0+

wanderer🌟 / js-primea-hypervisor



Tree: 5013b5ed5b183c9bd021b9b9b20f7df558b0a664

Files: 5013b5ed5b183c9bd021b9b9b20f7df558b0a664 / 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