Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion packages/list/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { autoDetect, PortInfo } from '@serialport/bindings-cpp'
import { program, Option } from 'commander'
import { readFileSync } from 'node:fs'

const { version } = JSON.parse(readFileSync('../package.json', 'utf8'))
const { version } = JSON.parse(readFileSync(__dirname + '/../package.json', 'utf8'))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I humbly submit it might be better to use path.join(__dirname, '..', 'package.json');


const formatOption = new Option('-f, --format <type>', 'Format the output').choices(['text', 'json', 'jsonline', 'jsonl']).default('text')

Expand Down
2 changes: 1 addition & 1 deletion packages/terminal/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { OutputTranslator } from './output-translator'
import { autoDetect, AutoDetectTypes } from '@serialport/bindings-cpp'
import { readFileSync } from 'node:fs'

const { version } = JSON.parse(readFileSync('../package.json', 'utf8'))
const { version } = JSON.parse(readFileSync(__dirname + '/../package.json', 'utf8'))
const binding = autoDetect()

const makeNumber = (input: string) => Number(input)
Expand Down