Skip to content

Commit

Permalink
Utilize CJS require for 'read-package-json-fast'
Browse files Browse the repository at this point in the history
  • Loading branch information
bcomnes committed Jan 31, 2024
1 parent fdb3b79 commit 605ca15
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/read-package-json.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
*/
'use strict'

const readPackage = require('read-package-json-fast')

// ------------------------------------------------------------------------------
// Requirements
// ------------------------------------------------------------------------------
Expand All @@ -23,7 +25,7 @@ const joinPath = require('path').join
*/
module.exports = function readPackageJson () {
const path = joinPath(process.cwd(), 'package.json')
return import('read-package-json-fast').then(({ default: readPackage }) => readPackage(path)).then(body => ({
return readPackage(path).then(body => ({
taskList: Object.keys(body.scripts || {}),
packageInfo: { path, body }
}))
Expand Down

0 comments on commit 605ca15

Please sign in to comment.