A minifier for compressing and decompressing JSON state from the lexical editor. Version 1.0.1 reduces output size by mapping property names to single characters, using integer codes, and removing default values. It supports built-in minifiers for all official lexical nodes and allows custom node minifiers. The package provides full reversibility and includes unit tests. Release cadence is low; it's a focused utility with no major competitors beyond manual compression.
npm install lexical-minifierNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to minify and unminify lexical editor state using the lexical-minifier package inside an editor.update callback.
Consider forking or using an alternative if bug fixes are needed.
Store both original and minified state for debugging.
Ensure input is produced by $getRoot() or similar lexical export.
Use registerMinifier to add minifier for your custom node.
Change to import { minify } from 'lexical-minifier'Write a minifier and call registerMinifier(minifier).
Minified output is already JSON string; do not double-parse.
No dependency data recorded yet.