Skip to content

release: v1.3.0 - #58

Merged
Lellansin merged 1 commit into
masterfrom
release/1.3.0
Sep 20, 2026
Merged

Lellansin merged 1 commit into
masterfrom
release/1.3.0

Conversation

@Lellansin

Copy link
Copy Markdown
Owner

Summary

Release scanf v1.3.0.

This minor release adds an explicit, backward-compatible way to detect when standard input has reached EOF. Existing scanf() and sscanf() return values remain unchanged, while callers that read from stdin can now use scanf.isEOF() to stop input loops reliably.

Changes

  • Add scanf.isEOF() for detecting the EOF state of stdin.
  • Distinguish a real EOF from empty input and format mismatches at the underlying readSync() boundary.
  • Preserve the final input byte when redirected input does not end with a newline.
  • Add the corresponding TypeScript declaration and README documentation.
  • Add regression tests for EOF, empty lines, redirected input, and compatibility behavior.
  • Bump the package version from 1.2.1 to 1.3.0.

Compatibility

  • The existing scanf() and sscanf() interfaces and return values are unchanged.
  • The implementation remains compatible with Node.js 4 and does not require Promises, iterators, or newer language features.
  • Consumers can adopt scanf.isEOF() when needed without changing existing code.

Verification

  • 135 tests pass on the current local Node.js version.
  • 135 tests pass under Node.js 4.9.1.
  • npm pack --dry-run succeeds and reports scanf@1.3.0.
  • The feature PR passed the complete GitHub Actions matrix for Node.js 4 through 22.

Resolves #43.

@Lellansin
Lellansin merged commit 335ba68 into master Sep 20, 2026
24 checks passed
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.

How to detect EOF?

1 participant