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: keep certain directories #63

Open
tomjakubowski opened this issue Nov 2, 2019 · 3 comments
Open

Feature request: keep certain directories #63

tomjakubowski opened this issue Nov 2, 2019 · 3 comments

Comments

@tomjakubowski
Copy link

tomjakubowski commented Nov 2, 2019

Some NPM modules actually include Javascript modules named docs/..., and node-prune breaks these because docs/ are removed per the default rules. It would be nice, then, to mark a given directory to not be removed according to node-prune's rules:

$ node-prune --except node_modules/googleapis/../docs/
@tobias-klein
Copy link

Has there been any consideration to implement this feature? I would also appreciate it. In case of Ezra Project, I needed to remove one entry from the list of directories pruned. And for this simple patch I had to fork node-prune.

@tobias-klein
Copy link

I just noticed that a new release has actually been tagged in May this year, mentioning --include and --exclude flags. This is not mentioned in the README file, though. Is there a reason why no release is available?

@duniul
Copy link

duniul commented Dec 9, 2020

I wrote clean-modules to get around this, it's about as fast as node-prune and supports proper globbing by file paths.

To achieve the question from the OP you can e.g. do:

clean-modules --exclude **/googleapis/**/docs

--include and --exclude works for node-prune, but it only seems to validate the globs against file names.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants