Skip to content

Commit

Permalink
fix: cli
Browse files Browse the repository at this point in the history
  • Loading branch information
d3lm committed Jan 26, 2024
1 parent 9bde7d2 commit bd35800
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions bin/js-wasm-tools.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@

import fs from 'node:fs';
import { parseArgs } from 'node:util';
import initWasmTools, * as wasmTools from '../dist/js_wasm_tools.js';
import { fileURLToPath } from 'node:url';
import path from 'node:path';

const __dirname = fileURLToPath(new URL('.', import.meta.url));

const wasmTools = await import(path.join(__dirname, '../dist/js_wasm_tools.js'));
const initWasmTools = wasmTools.default;

class TextFormatter {
#styles = [];
Expand Down Expand Up @@ -51,7 +57,7 @@ async function _runCLI() {
return;
}

const bytes = fs.readFileSync('../dist/js_wasm_tools_bg.wasm');
const bytes = fs.readFileSync(path.join(__dirname, '../dist/js_wasm_tools_bg.wasm'));

await initWasmTools(bytes);

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "js-wasm-tools",
"version": "1.3.0",
"version": "1.3.1",
"author": "Dominic Elm",
"description": "JavaScript version of wasm-tools, low level tooling for WebAssembly in Rust",
"type": "module",
Expand Down

0 comments on commit bd35800

Please sign in to comment.