Socket
Socket
Sign inDemoInstall

read-package-json

Package Overview
Dependencies
Maintainers
6
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 6.0.0 to 6.0.1

87

lib/read-json.js

@@ -221,11 +221,8 @@ var fs = require('fs')

glob('*.gyp', { cwd: dir }, function (er, files) {
if (er) {
return cb(er)
}
if (data.gypfile === false) {
return cb(null, data)
}
gypfile_(file, data, files, cb)
})
if (data.gypfile === false) {
return cb(null, data)
}
glob('*.gyp', { cwd: dir })
.then(files => gypfile_(file, data, files, cb))
.catch(er => cb(er))
}

@@ -250,20 +247,11 @@

}
glob('server.js', { cwd: dir }, function (er, files) {
if (er) {
return cb(er)
fs.access(path.join(dir, 'server.js'), (err) => {
if (!err) {
s.start = 'node server.js'
data.scripts = s
}
serverjs_(file, data, files, cb)
return cb(null, data)
})
}
function serverjs_ (file, data, files, cb) {
if (!files.length) {
return cb(null, data)
}
var s = data.scripts || {}
s.start = 'node server.js'
data.scripts = s
return cb(null, data)
}
function authors (file, data, cb) {

@@ -299,17 +287,16 @@ if (data.contributors) {

var globOpts = { cwd: dir, nocase: true, mark: true }
glob('{README,README.*}', globOpts, function (er, files) {
if (er) {
return cb(er)
}
// don't accept directories.
files = files.filter(function (filtered) {
return !filtered.match(/\/$/)
glob('{README,README.*}', globOpts)
.then(files => {
// don't accept directories.
files = files.filter(function (filtered) {
return !filtered.match(/\/$/)
})
if (!files.length) {
return cb()
}
var fn = preferMarkdownReadme(files)
var rm = path.resolve(dir, fn)
return readme_(file, data, rm, cb)
})
if (!files.length) {
return cb()
}
var fn = preferMarkdownReadme(files)
var rm = path.resolve(dir, fn)
readme_(file, data, rm, cb)
})
.catch(er => cb(er))
}

@@ -352,11 +339,10 @@

cwd = path.resolve(path.dirname(file), cwd)
glob('**/*.[0-9]', { cwd }, function (er, mansGlob) {
if (er) {
return cb(er)
}
data.man = mansGlob.map(man =>
path.relative(dirname, path.join(cwd, man)).split(path.sep).join('/')
)
return cb(null, data)
})
glob('**/*.[0-9]', { cwd })
.then(mansGlob => {
data.man = mansGlob.map(man =>
path.relative(dirname, path.join(cwd, man)).split(path.sep).join('/')
)
return cb(null, data)
})
.catch(er => cb(er))
}

@@ -373,8 +359,5 @@

m = path.resolve(path.dirname(file), m)
glob('**', { cwd: m }, function (er, binsGlob) {
if (er) {
return cb(er)
}
bins_(file, data, binsGlob, cb)
})
glob('**', { cwd: m })
.then(binsGlob => bins_(file, data, binsGlob, cb))
.catch(er => cb(er))
}

@@ -381,0 +364,0 @@

{
"name": "read-package-json",
"version": "6.0.0",
"version": "6.0.1",
"author": "GitHub Inc.",

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

"dependencies": {
"glob": "^8.0.1",
"glob": "^9.3.0",
"json-parse-even-better-errors": "^3.0.0",

@@ -34,3 +34,3 @@ "normalize-package-data": "^5.0.0",

"@npmcli/eslint-config": "^4.0.0",
"@npmcli/template-oss": "4.5.1",
"@npmcli/template-oss": "4.12.0",
"tap": "^16.0.1"

@@ -48,5 +48,5 @@ },

"branches": 68,
"functions": 83,
"lines": 76,
"statements": 77,
"functions": 74,
"lines": 74,
"statements": 74,
"nyc-arg": [

@@ -59,4 +59,4 @@ "--exclude",

"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"version": "4.5.1"
"version": "4.12.0"
}
}
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