Sha256: 1d94031d6309d9b2e4b4776c7739a5f51d4d54dac2309a0d29e477c63281e2a3

Contents?: true

Size: 491 Bytes

Versions: 35

Compression:

Stored size: 491 Bytes

Contents

'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
	};
};

Version data entries

35 entries across 34 versions & 15 rubygems

Version Path
optimacms-0.1.61 spec/dummy/node_modules/read-pkg-up/index.js
disco_app-0.18.0 test/dummy/node_modules/read-pkg-up/index.js
disco_app-0.18.2 test/dummy/node_modules/read-pkg-up/index.js
tang-0.2.1 spec/tang_app/node_modules/read-pkg-up/index.js
groonga-client-model-6.0.0 test/apps/rails6.1.3/node_modules/read-pkg-up/index.js
groonga-client-model-6.0.0 test/apps/rails6.0.3.5/node_modules/read-pkg-up/index.js
ruby2js-4.0.4 lib/tasks/testrails/node_modules/read-pkg-up/index.js
ruby2js-4.0.3 lib/tasks/testrails/node_modules/read-pkg-up/index.js
tang-0.2.0 spec/tang_app/node_modules/read-pkg-up/index.js
tang-0.1.0 spec/tang_app/node_modules/read-pkg-up/index.js
tang-0.0.9 spec/tang_app/node_modules/read-pkg-up/index.js
enju_library-0.3.8 spec/dummy/node_modules/read-pkg-up/index.js
ilog-0.4.1 node_modules/read-pkg-up/index.js
ilog-0.4.0 node_modules/read-pkg-up/index.js
ilog-0.3.3 node_modules/read-pkg-up/index.js
jester-data-8.0.0 node_modules/read-pkg-up/index.js
ezii-os-5.2.1 node_modules/read-pkg-up/index.js
ezii-os-2.0.1 node_modules/read-pkg-up/index.js
ezii-os-1.1.0 node_modules/read-pkg-up/index.js
ezii-os-1.0.0 node_modules/read-pkg-up/index.js