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

Add mutator methods to allow ports ranges to be set with module-style imports #115

Merged
merged 1 commit into from
Aug 2, 2022

Conversation

inlined
Copy link
Contributor

@inlined inlined commented Feb 8, 2021

Ran into a compiler error when using portfinder in TypeScript. Module exports are considered immutable in typescript, so the following code won't compile:

import * as portfinder from "portfinder";

portfinder.basePort = 3000;

Instead, a new accessor method allows us to say portfinder.setBasePort(3000);

@inlined
Copy link
Contributor Author

inlined commented May 27, 2021

Ping?

@eriktrom
Copy link
Member

yep sorry for the delay

so unfortunately this lib has to work with node going back as far as v0.10.x - as enterprise code bases, believe it or not, sometimes never upgrade node itself, and this lib is used by more packages than one would at first imagine.

thanks though for being awesome and contributing. despite having to close this, i highly respect those who contribute to open source and I wish I could merge this for that sake alone but unfortunately i can't, there should be a contribution attempt chart b/c i think its such an important part of today's economy and society but until then, thanks will have to do :)

cheers

@eriktrom eriktrom closed this Jul 29, 2021
@inlined
Copy link
Contributor Author

inlined commented Jul 29, 2021

I'm confused. Why does offering a mutator method affect the version of node that can be used? The opposite is true; without this change portfinder won't be able to be used in a modern codebase but with this change it can be used in old or new codebases.

@eriktrom
Copy link
Member

eriktrom commented Aug 2, 2022

@inlined - I will revisit this per @MasterOdin's remarks on the issue I left, the same day I made my comment above your's. (Almost 1 year ago to the date)

Re-opening.

@eriktrom eriktrom reopened this Aug 2, 2022
@eriktrom eriktrom merged commit 38cf018 into http-party:master Aug 2, 2022
@eriktrom
Copy link
Member

eriktrom commented Aug 2, 2022

I'm confused. Why does offering a mutator method affect the version of node that can be used? The opposite is true; without this change portfinder won't be able to be used in a modern codebase but with this change it can be used in old or new codebases.

Correct.

PS - Sorry I haven't been around for the last 12 months. Knowing that was going to be the case, I left an issue at #122 - which until 4 days ago was mostly crickets. I have returned and will address the outstanding PR's and issues.

Thanks for your patience.

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

Successfully merging this pull request may close these issues.

None yet

2 participants