v2.0.0: Fix compatibility, simplify code, eliminate vulnerabilities#49
Merged
Conversation
- Fix deprecated new Buffer() → Buffer.from() - Fix node:os prefix → os for broader Node compatibility - Fix implicit global usageMessage variable - Fix .mv() promise handling (use .then/.catch properly) - Fix SSL cert path resolution (use cwd instead of __dirname) - Fix upload path resolution to use user-specified path - Simplify file path handling with path.dirname() - Replace GitHub fork serve-handler with official package + inline prefix strip - Update Express to latest v4 (fixes vulnerabilities) - Replace ESM-only clipboardy v3 with CommonJS-compatible v2 - Remove deprecated preferGlobal from package.json - Add engines field (node >= 10) - Add missing -q/--receive-port option - Fix HTML close tag in receive-form.html - Add proper type annotations to yargs options - Add 11 tests (unit + integration) - Bump version to 2.0.0
Copilot
AI
changed the title
v2.0.0: Simplify code, fix compatibility across Node versions, add tests
v2.0.0: Fix compatibility, simplify code, eliminate vulnerabilities
Jun 16, 2026
Copilot created this pull request from a session on behalf of
parvardegr
June 16, 2026 11:35
View session
parvardegr
marked this pull request as ready for review
June 16, 2026 12:21
parvardegr
approved these changes
Jun 16, 2026
Owner
|
@copilot add a step in ci/cd to run the tests also before publishing, maybe as the first step |
- Run tests across Node 14/16/18/20/22 before npm publish - Add separate CI workflow for push/PR to master/main - Update actions/checkout and actions/setup-node to v4
Contributor
Author
Done. Updated the publish workflow to run tests across Node 14/16/18/20/22 as a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Full review pass: fix bugs that break on modern Node, replace fragile dependencies, resolve all npm audit vulnerabilities, add tests and CI.
Bug fixes
new Buffer()→Buffer.from()(removed since Node 10).mv().then(err => ...)—.then()receives resolved value, not error; split into.then()/.catch()usageMessagevariable (implicit global)__dirnameinstead ofprocess.cwd()__dirnameinstead of user-specified pathpath.dirname()/path.basename()<a/>close tag in receive form HTMLCompatibility
require('node:os')→require('os')(prefix requires Node 14.18+)clipboardy@3(ESM-only) →clipboardy@2(CommonJS)serve-handler→ officialserve-handler@6.1.6with inline prefix stripengines: { node: ">=14.0.0" }preferGlobal-q/--receive-portCLI option (was in README but not in code)typeannotations to all yargs optionsSecurity
4.18.1→4.21.2— 12 → 0 npm audit vulnerabilitiesTests
assert— no framework dependency--help/--versionCI/CD
testjob before thepublishjob (needs: test)ci.ymlworkflow that runs the same test matrix on every push and PR to master/mainactions/checkoutandactions/setup-nodefrom v2 to v4