From 559c29cc312518273a55ba427a50d51c68be25e4 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Mon, 6 Jun 2022 15:08:05 +0300 Subject: [PATCH] fix: index: wabt returns Promise --- lib/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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({});