
Security News
Potemkin Understanding in LLMs: New Study Reveals Flaws in AI Benchmarks
New research reveals that LLMs often fake understanding, passing benchmarks but failing to apply concepts or stay internally consistent.
jsonschema-key-compression
Advanced tools
Compress json-data based on it's json-schema while still having valid json. It works by compressing long attribute-names into smaller ones and backwards.
For example this:
{
"firstName": "alice",
"lastName": "wonder",
"registerDate": "2019-06-01",
"country": "de",
"active": true,
"eyeColor": "brown"
}
becomes this:
{
"|a": "alice",
"|b": "wonder",
"|c": "2019-06-01",
"|d": "de",
"|e": true,
"|f": "brown"
}
The compressed version only needs 85 chars while the non-compressed version needs 123 chars. So by storing the compressed version, you can store up to 30% more data.
npm install jsonschema-key-compression --save
Creates a compression-table from the json-schema.
import {
createCompressionTable
} from 'jsonschema-key-compression';
const compressionTable = createCompressionTable(jsonSchema);
Compress a json-object based on it's schema.
import {
compressObject
} from 'jsonschema-key-compression';
const compressedObject = createCompressionTable(
compressionTable,
jsonObject
);
Decompress a compressed object.
import {
decompressObject
} from 'jsonschema-key-compression';
const jsonObject = decompressObject(
compressionTable,
compressionTable
);
Transform a chain of json-attributes into it's compresed format.
import {
compressedPath
} from 'jsonschema-key-compression';
const compressed = compressedPath(
compressionTable,
'whateverNested.firstName'
); // > '|a.|b'
Decompress a compressed path.
import {
decompressedPath
} from 'jsonschema-key-compression';
const decompressed = decompressedPath(
compressionTable,
'|a.|b' // from compressedPath
);
Compress a mango-query so that it can run over a NoSQL-Database that has stored compressed documents.
import {
compressQuery
} from 'jsonschema-key-compression';
const decompressed = compressQuery(
compressionTable,
{
selector: {
active: {
$eq: true
}
},
skip: 1,
limit: 1,
fields: [
'id',
'name'
],
sort: [
'name'
]
}
);
FAQs
Compress json-data based on its json-schema
The npm package jsonschema-key-compression receives a total of 13,995 weekly downloads. As such, jsonschema-key-compression popularity was classified as popular.
We found that jsonschema-key-compression demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
New research reveals that LLMs often fake understanding, passing benchmarks but failing to apply concepts or stay internally consistent.
Security News
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.