From c08d83d885cafeb4ac72ecece03f6be36a4c7c01 Mon Sep 17 00:00:00 2001 From: Luciano Mammino Date: Wed, 25 Jan 2023 09:55:52 +0000 Subject: [PATCH] Correctly referencing __dirname so thats compatible with windows --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index f6e76c1..a8fca7e 100644 --- a/index.js +++ b/index.js @@ -1,11 +1,12 @@ #!/usr/bin/env node +import { fileURLToPath } from 'node:url' import { join } from 'node:path' import { fork } from 'node:child_process' import { readFile } from 'node:fs/promises' import variationsStream from 'variations-stream' -const __dirname = new URL('.', import.meta.url).pathname +const __dirname = fileURLToPath(new URL('.', import.meta.url)) const pkg = JSON.parse(await readFile(new URL('./package.json', import.meta.url))) const defaultAlphabet = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'