Skip to content

Latest commit

 

History

History
22 lines (15 loc) · 643 Bytes

File metadata and controls

22 lines (15 loc) · 643 Bytes
description
Modern alternatives to the pkg-dir package for finding package root directories

Replacements for pkg-dir

empathic

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 ++]