{"id":19500586,"url":"https://github.com/naturalintelligence/nimnjs","last_synced_at":"2025-04-25T23:30:29.365Z","repository":{"id":65419365,"uuid":"122699409","full_name":"NaturalIntelligence/nimnjs","owner":"NaturalIntelligence","description":"JS implementation of nimn specification","archived":false,"fork":false,"pushed_at":"2023-10-14T11:49:28.000Z","size":387,"stargazers_count":45,"open_issues_count":0,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-05-01T11:46:40.291Z","etag":null,"topics":["compression","decoder","encoder","json","nimn","nimnjs"],"latest_commit_sha":null,"homepage":"https://solothought.com/nimn","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NaturalIntelligence.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"github":"NaturalIntelligence","custom":["https://paypal.me/naturalintelligence"]}},"created_at":"2018-02-24T03:29:43.000Z","updated_at":"2024-01-19T13:41:57.000Z","dependencies_parsed_at":"2023-10-15T11:57:49.729Z","dependency_job_id":null,"html_url":"https://github.com/NaturalIntelligence/nimnjs","commit_stats":{"total_commits":145,"total_committers":7,"mean_commits":"20.714285714285715","dds":"0.19310344827586212","last_synced_commit":"e097156f1116b3b7f3988547e8b7f5023c68d2f8"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NaturalIntelligence%2Fnimnjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NaturalIntelligence%2Fnimnjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NaturalIntelligence%2Fnimnjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NaturalIntelligence%2Fnimnjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NaturalIntelligence","download_url":"https://codeload.github.com/NaturalIntelligence/nimnjs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250912660,"owners_count":21506865,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["compression","decoder","encoder","json","nimn","nimnjs"],"created_at":"2024-11-10T22:08:59.221Z","updated_at":"2025-04-25T23:30:29.096Z","avatar_url":"https://github.com/NaturalIntelligence.png","language":"JavaScript","funding_links":["https://github.com/sponsors/NaturalIntelligence","https://paypal.me/naturalintelligence"],"categories":[],"sub_categories":[],"readme":"# nimnjs-node\nJS implementation of nimn specification. Highly Compressed JS object/JSON. 60% or more compressed than JSON, 40% or more compressed than msgpack\n\n\u003ca href=\"https://paypal.me/naturalintelligence\"\u003e \u003cimg src=\"static/img/support_paypal.svg\" alt=\"Stubmatic donate button\" width=\"200\"/\u003e\u003c/a\u003e\n\n\n\u003cimg align=\"right\" src=\"static/img/nimnjs-logo.png\" /\u003e \n\n## Introduction\nNIMN JS can parse JS object to nimn data and vice versa. See Nimn [specification](https://github.com/NaturalIntelligence/nimn-spec) for more detail.\n\n## Usages\nFirst install or add to your npm package\n```\n$npm install nimnjs\n```\n\n```js\nvar nimn = require(\"nimnjs\");\n\nvar objStructure = {\n    type : \"list\",\n    detail : {\n        type : \"map\",\n        detail : [{\n            name : \"name\",\n            type : \"string\"\n        },{\n            name : \"age\",\n            type : \"number\"\n        },{\n            name : \"isHuman\",\n            type : \"boolean\"\n        },{\n            name : \"address\",\n            type : \"string\"\n        },{\n            name : \"hobbies\",\n            type : \"list\",\n            detail : {\n                type : \"string\"\n            }\n        },{\n            name : \"project\",\n            type : \"map\",\n            detail: [{\n                name: \"title\",\n                type : \"string\"\n            },{\n                name: \"description\",\n                type : \"string\"\n            },{\n                name: \"status\",\n                type : \"string\"\n            }\n            ]\n        }\n        ]\n    }\n}\n\n\nvar schema = nimn.buildSchema(objStructure);\n\nvar jData = [{\n    \"name\" : \"somename\",\n    \"isHuman\" : true,\n    \"age\": 32,\n    \"address\" : \"I'll not tell you\",\n    hobbies : [ \n        null\n        , \"not reading \"+ parser.chars.missingPremitive +\" book\"\n        , \"watching \\\\\"+ parser.chars.nilPremitive +\" movie\"\n    ],\n    project : {\n        title : \"nimn\",\n        //description : \"it is 80% smaller\",\n        status : \"rocking\"\n    }\n}]\n\nvar nimnDataString = nimn.stringify(schema, jData);\nvar result = nimn.parse(schema, nimnDataString);\nexpect(result).toEqual(jData); \n```\n\n### Flexibility\n\n* You can use old schema to parse nimn data created with old or new schema.\n* You can use new schema to parse nimn data created with old or new schema.\n\nNote that the fields must be added or deleted in the end of the map (object)\n\n* Fields name can be chaged in the schema used for encoding and decoding. But their type and order must not be changed.\n\n**Supported type**\n\n* *map* : Fixed key value pairs\n* *varmap* : Variable key value pairs where the values of any key have same structure\n* *list* : list of similar values\n* *boolean* : true / false\n* *string* : Any valid string\n* *number* : Any valid number\n\nInclude [dist](dist/nimn.js) in your HTML to use it in browser.\n\n\nCheck the [demo](https://amitkumargupta.work/nimn/) for instant use. It generates schema automatically with the help of [schema builder](https://github.com/NaturalIntelligence/nimnjs-schema-builder) when sample json is provided.\n\n\n## Support\nJoin the [official organization](https://github.com/NaturalIntelligence) on github to support it. It can not only save bandwidth but speed up communication, search and much more.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaturalintelligence%2Fnimnjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnaturalintelligence%2Fnimnjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaturalintelligence%2Fnimnjs/lists"}