Skip to content

Commit

Permalink
fix: handle BOM in package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
antongolub committed Jul 8, 2020
1 parent a81a044 commit 280d21d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module.exports = function nmTree (basePath, tree) {
const packageJsonPath = path.join(basePath, 'package.json')
const nodeModulesPath = path.join(basePath, 'node_modules')
if (fs.existsSync(packageJsonPath)) {
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath))
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8').trim())
tree[basePath] = packageJson
if (fs.existsSync(nodeModulesPath)) { // TODO: and is dir
const nodeModulesPackages = fs.readdirSync(nodeModulesPath)
Expand Down

0 comments on commit 280d21d

Please sign in to comment.