![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/mets.corals.io/wp-content/themes/metras/node_modules/read-pkg/ |
'use strict'; var path = require('path'); var loadJsonFile = require('load-json-file'); var normalizePackageData = require('normalize-package-data'); var pathType = require('path-type'); module.exports = function (fp, opts) { if (typeof fp !== 'string') { opts = fp; fp = '.'; } opts = opts || {}; return pathType.dir(fp) .then(function (isDir) { if (isDir) { fp = path.join(fp, 'package.json'); } return loadJsonFile(fp); }) .then(function (x) { if (opts.normalize !== false) { normalizePackageData(x); } return x; }); }; module.exports.sync = function (fp, opts) { if (typeof fp !== 'string') { opts = fp; fp = '.'; } opts = opts || {}; fp = pathType.dirSync(fp) ? path.join(fp, 'package.json') : fp; var x = loadJsonFile.sync(fp); if (opts.normalize !== false) { normalizePackageData(x); } return x; };