Skip to content
Build schema from JS object or JSON to feed into nimnjs
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
dist
static
tests
.gitignore
.npmignore
LICENSE
README.md
builder.js
index.html
package-lock.json
package.json

README.md

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.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.