| description |
|---|
Modern alternatives to the pkg-dir package for finding package root directories |
empathic provides a more generic way to find files and directories upwards.
The main difference is that empathic is synchronous, so you should no longer await the result.
Example:
import { dirname } from 'node:path' // [!code ++]
import * as pkg from 'empathic/package' // [!code ++]
import { packageDirectory } from 'pkg-dir' // [!code --]
const dir = await packageDirectory() // [!code --]
const dir = dirname(pkg.up()) // [!code ++]