Skip to content

Default pkg to the current package #172

@ehmicky

Description

@ehmicky

The pkg option must be set with the package's package.json.

However this does not work well with ES imports. At the moment, importing JSON files with ES imports is still experimental in Node.js.

Also, hardcoding the path to package.json can be tricky when transpiling is involved. For example, my binary file is at src/bin.js, but it is transpiled to build/src/bin.js. If I want to run both files, I need to dynamically find the path to package.json with a library like read-pkg-up.

Adding an option to automatically find the package (with read-pkg-up for example) would solve this problem. This option would probably need user to pass __dirname to be able to find the right package.json.

What do you think?

I can submit a PR if needed.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions