Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

read-package-json

Package Overview
Dependencies
Maintainers
4
Versions
91
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

read-package-json - npm Package Compare versions

Comparing version 2.0.3 to 2.0.4

2

package.json
{
"name": "read-package-json",
"version": "2.0.3",
"version": "2.0.4",
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",

@@ -5,0 +5,0 @@ "description": "The thing npm uses to read package.json files with semantics and defaults and validation",

@@ -61,3 +61,14 @@ var fs

function parseJson (file, er, d, log, strict, cb) {
if (er && er.code === 'ENOENT') return indexjs(file, er, log, strict, cb)
if (er && er.code === 'ENOENT') {
return fs.stat(path.dirname(file), function (err, stat) {
if (!err && stat && !stat.isDirectory()) {
// ENOTDIR isn't used on Windows, but npm expects it.
er = Object.create(er)
er.code = 'ENOTDIR'
return cb(er)
} else {
return indexjs(file, er, log, strict, cb)
}
})
}
if (er) return cb(er)

@@ -64,0 +75,0 @@

@@ -13,1 +13,9 @@ var tap = require('tap')

})
tap.test('ENOTDIR for non-directory packages', function (t) {
readJson(path.resolve(__filename, 'package.json'), function (er, data) {
t.ok(er)
t.equal(er.code, 'ENOTDIR')
t.end()
})
})
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc