Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switch import to readFileSync #17

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -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}`
);
Expand Down