Skip to content

Commit

Permalink
fix: update version import to be consistent with WebTorrent (#310)
Browse files Browse the repository at this point in the history
* fix: update version to use require to be more consistent with WebTorrent

* fix: linting
  • Loading branch information
SilentBot1 committed Jun 13, 2024
1 parent 0736051 commit 4bf287b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bin/cmd.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import Yargs from 'yargs'
import { hideBin } from 'yargs/helpers'
import open from 'open'

const { version: webTorrentCliVersion } = JSON.parse(fs.readFileSync(new URL('../package.json', import.meta.url)))
import webTorrentCliVersion from '../version.cjs'
const webTorrentVersion = WebTorrent.VERSION

const yargs = Yargs()
Expand Down
2 changes: 2 additions & 0 deletions version.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Exports package.json version to work around "with" and "assert" imports for backwards compatability.
module.exports = require('./package.json').version

0 comments on commit 4bf287b

Please sign in to comment.