Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request]: Ability to filter output #12

Open
1 task done
kindoflew opened this issue Dec 21, 2022 · 0 comments
Open
1 task done

[Feature Request]: Ability to filter output #12

kindoflew opened this issue Dec 21, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@kindoflew
Copy link
Contributor

kindoflew commented Dec 21, 2022

Describe your request

Currently, every dependency and devDependency is used when determining whether a Node version is compatible.

In some cases this doesn't make sense and we can filter them out internally (the first thing that comes to mind are any @types/{package} dependencies -- they're just TypeScript files that don't care about Node versions).

In other cases, a user might not care about certain packages and don't want to see them in the output. Or maybe they don't want to see packages that don't specify an engines filed (the ones that show undefined in the table output).

In a third case, the user might want to see only packages that are not compatible with the given Node version (or the opposite -- only the ones that are).

We should implement some kind of --filter option that we can pass a string of package names to that won't be included in the final output. Bonus points if the user can use RegEx or glob patterns (ie, @package-name/*).

We could also add an --only option that could take some pre-set options (such as compatible, not-compatible, defined, undefined, etc). Or maybe it's incompatible? I don't know, maybe we pick a word that's easier to type?

Possible Implementation

The main depngn function could take a second argument -- options -- that should be an object (so we can extend it later) with a filter field (an array of strings to ignore). In the cli function, we could parse a --filter arg and convert the string to an array and pass it to the depngn function. Beyond that, nothing would have to change.

Code of Conduct

  • I agree to follow this project's Code of Conduct
@kindoflew kindoflew added the enhancement New feature or request label Dec 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant