Skip to content

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

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
  • read-package-up
    • replaced by empathic/package
    • replaced by empathic/package and pkg-types if you need strong types
  • read-pkg
    • replaced by pkg-types
  • read-pkg-up
    • replaced by empathic/package
    • replaced by empathic/package and pkg-types if you need strong types

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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