Socket
Socket
Sign inDemoInstall

pkg-dir

Package Overview
Dependencies
6
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 6.0.0 to 6.0.1

4

index.js
import path from 'node:path';
import {findUp, findUpSync} from 'find-up';
export async function packageDirectory({cwd}) {
export async function packageDirectory({cwd} = {}) {
const filePath = await findUp('package.json', {cwd});

@@ -9,5 +9,5 @@ return filePath && path.dirname(filePath);

export function packageDirectorySync({cwd}) {
export function packageDirectorySync({cwd} = {}) {
const filePath = findUpSync('package.json', {cwd});
return filePath && path.dirname(filePath);
}
{
"name": "pkg-dir",
"version": "6.0.0",
"version": "6.0.1",
"description": "Find the root directory of a Node.js project or npm package",

@@ -5,0 +5,0 @@ "license": "MIT",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc