Skip to content

Commit

Permalink
Fix NodeJS not loading worker on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Hill-98 authored Apr 28, 2024
1 parent 0989c1a commit 40fb2f9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/libarchive-node.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { Worker } from "worker_threads";
import { URL } from "url";
import { dirname } from "path";
import { fileURLToPath } from "url";
import * as Comlink from "comlink";
import nodeEndpoint from "comlink/dist/esm/node-adapter";
import { Archive } from "./libarchive";
export * from "./libarchive";

const __dirname = new URL(".", import.meta.url).pathname;
const __dirname = dirname(fileURLToPath(import.meta.url));

Archive.init({
getWorker: () => new Worker(`${__dirname}/worker-bundle-node.mjs`),
Expand Down

0 comments on commit 40fb2f9

Please sign in to comment.