Installation Verification

This guide helps you verify that the Extended Markdown ADF Parser is properly installed and working correctly with both CommonJS and ES Modules.

Module System Support Test

This package supports both CommonJS and ES Modules automatically. Test the approach that matches your environment:

CommonJS Test

test-commonjs.js:

const { Parser } = require('extended-markdown-adf-parser');

const parser = new Parser();
console.log('✅ CommonJS installation successful!');

// Quick functionality test
const markdown = '# Hello World\n\nThis is a **test** document.';
const adf = parser.markdownToAdf(markdown);
const backToMarkdown = parser.adfToMarkdown(adf);

console.log('✅ CommonJS conversion working!');
console.log('Original:', markdown);
console.log('Round-trip result:', backToMarkdown);

// Test modular imports
const { StreamingParser } = require('extended-markdown-adf-parser/streaming');
console.log('✅ CommonJS modular imports working!');

ES Modules Test

test-esm.mjs (or use .js with "type": "module" in package.json):

TypeScript Test

test-typescript.ts:

Mixed Environment Test

test-mixed.js (CommonJS file that tests both approaches):

Run the Tests

Choose the test that matches your environment:

Expected Output

All tests should produce output similar to:

Updating

Version Compatibility

Package Version
Node.js
TypeScript
Features

1.0.x

20+

4.5+

All features

0.9.x

18+

4.0+

Legacy support

Development Setup

For contributing to the package or running from source:

Last updated