diff --git a/lib/index.js b/lib/index.js index 8f7aff9..82d23e2 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,4 +1,4 @@ -const wabt = require('wabt')(); +const createWabt = require('wabt'); const util = require('util'); getDecoderEncoder = () => { @@ -14,6 +14,7 @@ getDecoderEncoder = () => { } module.exports = async (input, importObject) => { + const wabt = await createWabt(); const { Decoder, Encoder } = getDecoderEncoder(); const wasmModule = wabt.parseWat('inline', new Encoder('utf-8').encode(input)); const { buffer } = wasmModule.toBinary({});