Compress JSON data based on its JSON Schema by replacing long attribute names with shorter ones. Version 1.7.0 is stable, actively maintained, and ships TypeScript types. Key differentiator: it preserves valid JSON structure, making it suitable for storage in NoSQL databases or browser storage where gzip is inefficient on small payloads. Provides 40% size reduction on average. Does not require a build step or schema transformation.
npm install jsonschema-key-compressionNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows full round-trip: schema -> compression table -> compress object -> decompress object.
Always use the same schema object for createCompressionTable as the data conforms to.
Consider additional compression (e.g., gzip) for value-heavy payloads.
Always decompress before using the data in logic that depends on original key names.
N/A
Ensure the schema is a valid JSON Schema object with a 'properties' key for objects, or use a schema that defines the object structure explicitly.
Pass a valid JSON Schema object to createCompressionTable.
No dependency data recorded yet.