New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

nimnjs

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nimnjs

Schema aware compression of JS object/JSON data. 60% more compressed than json

  • 1.3.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.1K
decreased by-12.76%
Maintainers
1
Weekly downloads
 
Created
Source

nimnjs-node

JS implementation of nimn specification. Highly Compressed JS object/JSON. 60% or more compressed than JSON, 40% or more compressed than msgpack

Known Vulnerabilities Travis ci Build Status Coverage Status Try me

Become a Patron! Stubmatic donate button

Introduction

NIMN JS can parse JS object to nimn data and vice versa. See Nimn specification for more detail.

Usages

First install or add to your npm package

$npm install nimnjs
var nimn = require("nimnjs");

var schema = {
    "name": "string",
    "age": "number",
    "human": "boolean",
    "projects": [{
        "name": "string",
        "decription": "string"
    }]
}

var nimnInstance = new nimn();
nimnInstance.addSchema(schema);

var data = {
    "name" : "amit",
    "age" : 32,
    "human" : true,
    "projects" : [
        {
            "name": "some",
            "decription" : "some long description"
        }
    ]
}

var result = nimnInstance.encode(data);//Æamitº32ÙÇÆsomeºsome long description
result = nimnInstance.decode(result);
expect(result).toEqual(data); 

For date compression

var nimnDateparser = require("nimn-date-parser");
//generate schema and data
var nimnInstance = new nimn();
nimnInstance.addDataHandler("date",function(val){
    return nimnDateparser.parse(val,true,true,true)
},function(val){
    return nimnDateparser.parseBack(val,true,true,true)
});
nimnInstance.addSchema(schema); //add after adding all data handlers

var nimndata = nimnInstance.encode(data);

Encode enum type

var nimnInstance = new nimn();
nimnInstance.addDataHandler("status",null,null,{
    "M" : "Married",
    "S" : "Single"
});
nimnInstance.addSchema(schema); //add after adding all data handlers

Just mark a data type

var nimnInstance = new nimn();
nimnInstance.addDataHandler("image");
nimnInstance.addSchema(schema); //add after adding all data handlers

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.

Support

I need your expert advice, and contribution to grow nimn (निम्न) so that it can support all mazor languages. Please join the official organization on github to support it. And ask your friends, and colleagues to give it a try. It can not only save bandwidth but speed up communication, search and much more.

Worth to mention

  • 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.

Keywords

FAQs

Package last updated on 28 Apr 2018

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc