![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
JS implementation of nimn specification. Highly Compressed JS object/JSON. 60% or more compressed than JSON, 40% or more compressed than msgpack
NIMN JS can parse JS object to nimn data and vice versa. See Nimn specification for more detail.
First install or add to your npm package
$npm install nimnjs
var nimn = require("nimnjs");
var objStructure = {
type : "list",
detail : {
type : "map",
detail : [{
name : "name",
type : "string"
},{
name : "age",
type : "number"
},{
name : "isHuman",
type : "boolean"
},{
name : "address",
type : "string"
},{
name : "hobbies",
type : "list",
detail : {
type : "string"
}
},{
name : "project",
type : "map",
detail: [{
name: "title",
type : "string"
},{
name: "description",
type : "string"
},{
name: "status",
type : "string"
}
]
}
]
}
}
var schema = nimn.buildSchema(objStructure);
var jData = [{
"name" : "somename",
"isHuman" : true,
"age": 32,
"address" : "I'll not tell you",
hobbies : [
null
, "not reading "+ parser.chars.missingPremitive +" book"
, "watching \\"+ parser.chars.nilPremitive +" movie"
],
project : {
title : "nimn",
//description : "it is 80% smaller",
status : "rocking"
}
}]
var nimnDataString = nimn.stringify(schema, jData);
var result = nimn.parse(schema, nimnDataString);
expect(result).toEqual(jData);
Note that the fields must be added or deleted in the end of the map (object)
Supported type
Include dist in your HTML to use it in browser.
Check the demo for instant use. It generates schema automatically with the help of schema builder when sample json is provided.
Join the official organization on github to support it. It can not only save bandwidth but speed up communication, search and much more.
List of applications and projects using Nimn. (Raise an issue to submit yours)
imglab : Web based tool to label images for object. So that they can be used to train dlib or other object detectors. You can integrate 3rd party libraries for fast labeling.
अनुमार्गक (anumargak) : The fastest router for node web servers.
Stubmatic : A stub server to mock behaviour of HTTP(s) / REST / SOAP services.
fastify-xml-body-parser : Fastify plugin / module to parse XML payload / body into JS object using fast-xml-parser.
fast-lorem-ipsum : Generate lorem ipsum words, sentences, paragraph very quickly.
Grapes : Flexible Regular expression engine which can be applied on char stream. (under development)
fast XML Parser : Fastest pure js XML parser for xml to js/json and vice versa. And XML validation.
FAQs
Schema aware compression of JS object/JSON data. 60% more compressed than json
We found that nimnjs 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
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.