We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 05fcfdc commit c1255e1Copy full SHA for c1255e1
bin/hyp.js
@@ -2,6 +2,8 @@
2
3
import subcommand from 'subcommand'
4
import fs from 'fs'
5
+import path from 'path'
6
+import { fileURLToPath } from 'url'
7
8
import * as hyper from '../lib/hyper/index.js'
9
@@ -74,7 +76,7 @@ match(argv)
74
76
// error output when no/invalid command is given
75
77
function none (args) {
78
if (args.version) {
- const packageJson = JSON.parse(fs.readFileSync('./package.json', 'utf8'))
79
+ const packageJson = JSON.parse(fs.readFileSync(path.join(fileURLToPath(import.meta.url), '../../package.json'), 'utf8'))
80
console.log(packageJson.version)
81
process.exit(0)
82
}
0 commit comments