Skip to content

Commit eded337

Browse files
author
Glynn Bird
committed
a nicer way to load the package.json to get pkg.name & pkg.version
1 parent 954c291 commit eded337

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

lib/nano.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ import { PassThrough, Readable } from 'node:stream'
1515
import ChangesReader from './changesreader.js'
1616
import CookieJar from './cookie.js'
1717
import MultiPartFactory from './multipart.js'
18-
import fs from 'node:fs'
19-
import path from 'node:path'
20-
const pkg = JSON.parse(fs.readFileSync(path.join(import.meta.dirname, '..', 'package.json'), { encoding: 'utf8' }))
18+
import pkg from '../package.json' with { type: 'json' }
2119

2220
const SCRUBBED_STR = 'XXXXXX'
2321

0 commit comments

Comments
 (0)