git ssb

0+

wanderer🌟 / js-primea-hypervisor



Tree: a5ab0fcd21ce8f881036e23c0db45f31bdd8ec38

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