From abd94a7f5a50f43c797a11b53549ae48fff667c3 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Mon, 10 Oct 2016 03:43:44 +0200 Subject: add node_modules to address #4364 --- node_modules/read-pkg-up/index.js | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 node_modules/read-pkg-up/index.js (limited to 'node_modules/read-pkg-up/index.js') diff --git a/node_modules/read-pkg-up/index.js b/node_modules/read-pkg-up/index.js new file mode 100644 index 000000000..beb3d4832 --- /dev/null +++ b/node_modules/read-pkg-up/index.js @@ -0,0 +1,31 @@ +'use strict'; +var findUp = require('find-up'); +var readPkg = require('read-pkg'); + +module.exports = function (opts) { + return findUp('package.json', opts).then(function (fp) { + if (!fp) { + return {}; + } + + return readPkg(fp, opts).then(function (pkg) { + return { + pkg: pkg, + path: fp + }; + }); + }); +}; + +module.exports.sync = function (opts) { + var fp = findUp.sync('package.json', opts); + + if (!fp) { + return {}; + } + + return { + pkg: readPkg.sync(fp, opts), + path: fp + }; +}; -- cgit v1.2.3