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

bin support #35

Closed
wants to merge 4 commits into from
Closed

bin support #35

wants to merge 4 commits into from

Conversation

vdegenne
Copy link

@vdegenne vdegenne commented Oct 6, 2019

Could you review this PR and consider it to be interesting.
I just added a bin file and the bin property in the package.json file.
So when the package is installed globally npm i -g get-port one can actually type the following in the system terminal :

get-port for any available port
get-port 3000 3020 for the preferred ports
get-port -r 3000,3100 for the range

I found it useful for myself to check if a port is available before using it in my application or sometimes even I just want the system to choose a port that I'll be using fixed throughout my project.

If you think that is interesting, please accept the PR and I let you change the readme to introduce this feature.

@vdegenne
Copy link
Author

vdegenne commented Oct 6, 2019

I fixed the bin file to agree with the es-lint rules, there is a last failing rule however, that I can't fix.
It seems to be a bug : mysticatea/eslint-plugin-node#126
But I tested locally and the bin support is working fine.

@sindresorhus
Copy link
Owner

There's already a CLI, just in a separate package: https://github.com/sindresorhus/get-port-cli PR welcome there if there's anything missing.

@vdegenne
Copy link
Author

vdegenne commented Oct 6, 2019

Oh I didn't know.
What is the motivation behind separating both the API and the CLI by the way ?
Given that both the API and the CLI are very small in size, it would have been great to bundle the both together, just my opinion.

@sindresorhus
Copy link
Owner

sindresorhus/ama#17

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