UNPKG

eslint-config-lemon

Version:

<div align="center"> <br> <img width="400" src="logo.svg"> <br> <br> </div>

28 lines (23 loc) 619 B
import path from 'node:path'; import {findUp, findUpSync} from 'find-up'; import {readPackage, readPackageSync} from 'read-pkg'; export async function readPackageUp(options) { const filePath = await findUp('package.json', options); if (!filePath) { return; } return { packageJson: await readPackage({...options, cwd: path.dirname(filePath)}), path: filePath, }; } export function readPackageUpSync(options) { const filePath = findUpSync('package.json', options); if (!filePath) { return; } return { packageJson: readPackageSync({...options, cwd: path.dirname(filePath)}), path: filePath, }; }