Skip to content

Replace find-pkg and friends with empathic or fd-package-json #158

Open
@43081j

Description

@43081j

Packages such as these:

  • find-pkg
    • replaced by pkg.up({ cwd })
  • find-file-up
    • replaced by find.up(name, { cwd })
  • find-up-simple
    • replaced by find.up(name, { cwd })
  • find-up
    • replaced by find.up(name, { cwd })
  • pkg-dir
    • replaced by dirname(pkg.up({ cwd }))
  • find-cache-dir
    • replaced by pkg.cache
  • find-cache-directory
    • replaced by pkg.cache

and more, can all be replaced by empathic:

https://github.com/lukeed/empathic

this is much faster and usually smaller to install

empathic is ESM only. if that blocks us, we can use fd-package-json to find the closest package.json. but there is no obvious replacement for the generic case. you could use walk-up-path but would need more inline logic

with require(esm) being in all LTS of node now, we may be able to use empathic still if the projects have a high enough engine requirement

Metadata

Metadata

Assignees

No one assigned

    Labels

    umbrella issueThis issue contains a list of dependents of a package and tracks the progress in each

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions