detect-port
detect-port copied to clipboard
feat: refactor with typescript to support esm and cjs both
BREAKING CHANGE: Drop Node.js < 16 support
- 使用 ts 重构
- 使用 tshy 支持 esm 和 cjs
- test 使用 test-runner (这里需要 node v18 版本)
merge from https://github.com/node-modules/detect-port/pull/51
Summary by CodeRabbit
-
New Features
- Introduced
waitPortfunction to wait for a specified port to become available. - Added CLI tool tests for version display, usage information, available ports, and verbose logging.
- Introduced
-
Bug Fixes
- Improved
detectPortfunction to handle different parameter combinations and enhance error handling.
- Improved
-
Documentation
- Updated
.gitignoreto include new patterns and files.
- Updated
-
Chores
- Updated Node.js versions in workflows to support newer versions (16, 18, 20, 22).
- Refined ESLint configurations to extend TypeScript rules and enforce node prefix conventions.
- Updated
package.jsondependencies and scripts for better development workflow.
-
Refactor
- Migrated CommonJS
requireto ES module imports for better compliance with modern JavaScript standards.
- Migrated CommonJS