https://github.com/naturalintelligence/nimnjs-schema-builder
Build schema from JS object or JSON to feed into nimnjs
https://github.com/naturalintelligence/nimnjs-schema-builder
builder json nimn schema
Last synced: about 1 month ago
JSON representation
Build schema from JS object or JSON to feed into nimnjs
- Host: GitHub
- URL: https://github.com/naturalintelligence/nimnjs-schema-builder
- Owner: NaturalIntelligence
- License: mit
- Created: 2018-02-25T09:50:42.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-11-08T01:39:02.000Z (over 6 years ago)
- Last Synced: 2025-04-24T15:45:08.148Z (about 1 month ago)
- Topics: builder, json, nimn, schema
- Language: JavaScript
- Homepage: https://nimndata.github.io/nimnjs-schema-builder/
- Size: 41 KB
- Stars: 4
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nimnjs-schema-builder
Build schema from JS object or JSON to feed into [nimnjs](https://github.com/nimndata/nimnjs-node).## Usages
First install or add to your npm package
```
$npm install nimn_schema_builder
``````js
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](dist/nimn-schema-builder.js) folder.
Check the [demo](https://nimndata.github.io/nimnjs-schema-builder/) for instant use.