🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

nimn_schema_builder

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nimn_schema_builder

Build schema from JS object or JSON to feed into nimnjs

2.0.0
latest
Source
npm
Version published
Weekly downloads
9.3K
52.42%
Maintainers
1
Weekly downloads
 
Created
Source

nimnjs-schema-builder

Build schema from JS object or JSON to feed into nimnjs.

Usages

First install or add to your npm package

$npm install nimn_schema_builder
var builder = require("nimn_schema_builder");

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

var schema = builder.build(data);

/*
var schema = {
    "type": "map",
    "detail": [
        {
            "type": "string",
            "name": "name"
        },
        {
            "type": "number",
            "name": "age"
        },
        {
            "type": "boolean",
            "name": "human"
        },
        {
            "type": "list",
            "detail": {
                "type": "map",
                "detail": [
                    {
                        "type": "string",
                        "name": "name"
                    },
                    {
                        "type": "string",
                        "name": "description"
                    }
                ]
            },
            "name": "projects"
        }
    ]
}
*/

You can also use it in browser from dist folder.

Check the demo for instant use.

Keywords

nimn

FAQs

Package last updated on 10 Jun 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