🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

read-package-up

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

read-package-up

Read the closest package.json file

11.0.0
latest
Source
npm
Version published
Weekly downloads
2.1M
-12.67%
Maintainers
1
Weekly downloads
 
Created

What is read-package-up?

The 'read-package-up' npm package is a utility that helps you read the closest package.json file, starting from a specified directory and traversing upwards. It is useful for tasks that require information from the package.json file, such as versioning, dependency management, and configuration.

What are read-package-up's main functionalities?

Read the closest package.json

This feature allows you to read the closest package.json file starting from the current directory and moving upwards. The result includes the path to the package.json file and its contents.

const readPackageUp = require('read-package-up');

(async () => {
  const result = await readPackageUp();
  console.log(result);
})();

Specify a starting directory

This feature allows you to specify a starting directory from which the search for the closest package.json file will begin. This is useful if you want to start the search from a specific location rather than the current working directory.

const readPackageUp = require('read-package-up');

(async () => {
  const result = await readPackageUp({ cwd: '/path/to/start/directory' });
  console.log(result);
})();

Other packages similar to read-package-up

Keywords

json

FAQs

Package last updated on 04 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts