Repository navigation
v1.1.0 - Dual Module Support (CommonJS + ESM)
π Extended ADF Markdown Parser v1.1.0
β¨ Major Features
π Dual Module Support
- CommonJS:
const { Parser } = require('extended-markdown-adf-parser'); - ES Modules:
import { Parser } from 'extended-markdown-adf-parser'; - Automatic Selection: Package automatically chooses the right format for your environment
- Zero Configuration: Works out-of-the-box with both module systems
π‘οΈ Enhanced Error Handling
- Graceful Degradation: Better error recovery by default
- Strict Mode: Optional strict validation when needed
- Better Error Messages: More descriptive error reporting
- Fallback Strategies: Improved handling of malformed input
π¦ Build System Improvements
- Dual Builds: Separate CommonJS (
.js) and ESM (.mjs) outputs - Tree Shaking: ESM builds support optimal bundling
- TypeScript: Complete type definitions for both module systems
- Modular Imports: Sub-module exports for smaller bundle sizes
π§ Technical Improvements
Package Exports Structure
dist/
βββ index.js # CommonJS main entry
βββ index.mjs # ES Modules main entry
βββ index.d.ts # TypeScript definitions
βββ streaming.js/.mjs # Streaming module (both formats)
βββ performance.js/.mjs # Performance module (both formats)
βββ errors.js/.mjs # Error handling (both formats)
Usage Examples
ES Modules (Recommended):
import { Parser } from 'extended-markdown-adf-parser';
import { StreamingParser } from 'extended-markdown-adf-parser/streaming';CommonJS:
const { Parser } = require('extended-markdown-adf-parser');
const { StreamingParser } = require('extended-markdown-adf-parser/streaming');TypeScript:
import { Parser, type ADFDocument, type ConversionOptions } from 'extended-markdown-adf-parser';π Documentation Updates
- Complete Module System Guide: Comprehensive documentation for both CommonJS and ESM
- Installation Verification: New test scripts for both module systems
- Troubleshooting: Enhanced guides for module system issues
- Framework Integration: Updated examples for React, Vue, Express, and more
- Advanced Configuration: Bundle optimization and lazy loading techniques
π Quality Metrics
- β Tests: 67/67 passing (100% success rate)
- β Coverage: 18/18 validation checks passed
- β Performance: Avg 0.48ms processing time
- β Memory: 1000+ documents processed efficiently
- β Compatibility: Works with Node.js 16+ (CommonJS) and 18+ (ESM)
π¨ Breaking Changes
- Package now defaults to graceful error handling instead of strict validation
- Use
{ strict: true }option for previous strict behavior - Enhanced TypeScript types may require updates in strict TypeScript projects
π Migration Guide
From v1.0.x to v1.1.0
No changes required for basic usage - both module systems work automatically:
// This continues to work exactly as before
import { Parser } from 'extended-markdown-adf-parser';
// OR
const { Parser } = require('extended-markdown-adf-parser');For strict error handling (if you relied on previous strict behavior):
const parser = new Parser({ strict: true });π Framework Compatibility
- β Node.js: 16+ (CommonJS), 18+ (ESM)
- β TypeScript: 4.5+
- β Webpack: 5+ (automatic ESM selection)
- β Vite/Rollup: Full ESM support
- β Next.js: Both App Router and Pages Router
- β React: Create React App, Vite, custom builds
- β Vue: Vue CLI, Vite, Nuxt
- β Express: Both CommonJS and ESM setups
- β Serverless: Vercel, AWS Lambda, Netlify
Full Changelog: v1.0.7...v1.1.0