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.
5.0.0 Modernization
Major Improvements
1. ✅ ES Modules
require) to ES modules (import/export)"type": "module"to package.jsonexportsfield for better module resolution2. ✅ Async/Await API
3. ✅ Callback-Based Progress Tracking
4. ✅ Proper Error Classes
ConversionError- For conversion failuresConversionTimeoutError- For timeoutsAuthenticationError- For auth failures5. ✅ Class-Based API
IDRCloudClientclass - Main client with clean, promise-based methods6. ✅ Streaming with
openAsBlob()fs.openAsBlob()for efficient file streaming7. ✅ Zero Dependencies
form-datadependencyfetchAPIFormData8. ✅ Better Retry Logic
9. ✅ Modern Code
API Comparison
Old Way (v4.x):
New Way (v5.0):
With Progress (v5.0):
Files Created/Modified
Modified:
idrcloudclient.js- Completely rewritten with modern APIpackage.json- Updated to v5.0.0, ES modules, Node.js 20+New Files:
examples.js- 11 complete usage examplesexamples-browser.html- Browser usage examples with File APIMIGRATION.md- Comprehensive migration guideBROWSER_SUPPORT.md- Browser-specific guidance and security notesMODERNIZATION_SUMMARY.md- This file documenting the v5.0 changesBenefits Summary
Key Features
Token Authentication for IDR Cloud
The v5.0 API supports both token-based authentication (for IDR cloud) and username/password authentication (for self-hosted servers):
Universal JavaScript Support
The same library works in both Node.js and browsers with zero modifications. The code automatically detects the environment and adapts accordingly:
fs.openAsBlob()), Buffers, and BlobsFire-and-Forget Pattern
The v5.0 API supports non-polling mode for async processing:
Notes
fs.openAsBlob()is memory-efficient for large PDFs in Node.jsexamples.jsdemonstrate different usage patterns and features