From d37eb288ecaf4b7d23277dcd591115b8ff06efb1 Mon Sep 17 00:00:00 2001 From: rmchale Date: Mon, 4 Jul 2022 12:44:52 -0500 Subject: [PATCH] switch import to readFileSync --- src/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 74c998e..f923ab1 100755 --- a/src/index.js +++ b/src/index.js @@ -9,6 +9,8 @@ import './warning.js'; import init from './init.js'; import run from './run.js'; import help from './help.js'; +import { readFileSync } from "fs"; + const args = nanoparse(process.argv.slice(2)); const command = args._[0]; @@ -38,7 +40,8 @@ const commands = { init, run, async version() { - const {version} = (await import('../package.json', {assert: {type: 'json'}})).default + const packageJson = JSON.parse(readFileSync(require.resolve("../package.json")).toString()); + const {version} = packageJson.default console.log( 'req', `v${version}` );