import path__default from 'node:path';
import { findUp } from '../../../find-up@6.3.0/node_modules/find-up/index.mjs';

async function packageDirectory({
  cwd
} = {}) {
  const filePath = await findUp('package.json', {
    cwd
  });
  return filePath && path__default.dirname(filePath);
}

export { packageDirectory };
