git ssb

0+

wanderer🌟 / js-primea-hypervisor



Tree: 3293a87f5f8d4e902258609eb8f0c213b7c38192

Files: 3293a87f5f8d4e902258609eb8f0c213b7c38192 / 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