Gathering detailed insights and metrics for generate-schema-default-value
Gathering detailed insights and metrics for generate-schema-default-value
Gathering detailed insights and metrics for generate-schema-default-value
Gathering detailed insights and metrics for generate-schema-default-value
🧞 Convert JSON Objects to MySQL, JSON Schema, Mongoose, Google BigQuery, Swagger, and more.
npm install generate-schema-default-value
Typescript
Module System
Node Version
NPM Version
73.3
Supply Chain
99.4
Quality
74.7
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
892
Last Day
2
Last Week
3
Last Month
19
Last Year
191
MIT License
1,055 Stars
77 Commits
135 Forks
24 Watchers
2 Branches
13 Contributors
Updated on Jun 13, 2025
Minified
Minified + Gzipped
Latest Version
2.6.1
Package Id
generate-schema-default-value@2.6.1
Unpacked Size
41.67 kB
Size
10.50 kB
File Count
23
NPM Version
6.13.4
Node Version
12.16.1
Cumulative downloads
Total Downloads
Last Day
0%
2
Compared to previous day
Last Week
0%
3
Compared to previous week
Last Month
90%
19
Compared to previous month
Last Year
14.4%
191
Compared to previous year
2
Convert JSON Objects to MySQL Table Schema, JSON Schema, Mongoose Schema, ClickHouse Schema, Google BigQuery, or a Generic template for documentation, code generation, and more.
Install with npm:
1$ npm i --save generate-schema
Optionally, add -g
to the above if you want the generate-schema
command line executable.
Usage: generate-schema [options ...] [file]
Common Options:
-h, --help output usage information
-V, --version output the version number
-q, --quiet Skip help message in program output
Mode Options:
-g, --generic Generic JSON Primitives schema output
-j, --json-schema JSON Schema output
-s, --mysql MySQL Table Schema output
-m, --mongoose Mongoose Schema output
-b, --big-query Google BigQuery Schema output
-c, --clickhouse Clickhouse Table Schema output
When no file is specified, generate-schema
enters a REPL mode.
$ generate-schema -b
generate-schema v2.5.1 (bigquery)
Type "exit" to quit.
Type {a:"b"} to see an example.
> {a:"b"}
[
{
"name": "a",
"type": "STRING",
"mode": "NULLABLE"
}
]
1var GenerateSchema = require('generate-schema')
// Capture Schema Output
var schema = GenerateSchema.json('Product', [
{
"id": 2,
"name": "An ice sculpture",
"price": 12.50,
"tags": ["cold", "ice"],
"dimensions": {
"length": 7.0,
"width": 12.0,
"height": 9.5
},
"warehouseLocation": {
"latitude": -78.75,
"longitude": 20.4
}
},
{
"id": 3,
"name": "A blue mouse",
"price": 25.50,
"dimensions": {
"length": 3.1,
"width": 1.0,
"height": 1.0
},
"warehouseLocation": {
"latitude": 54.4,
"longitude": -32.7
}
}
])
Outputs:
1{ 2 "$schema": "http://json-schema.org/draft-04/schema#", 3 "title": "Product Set", 4 "type": "array", 5 "items": { 6 "type": "object", 7 "properties": { 8 "id": { 9 "type": "number" 10 }, 11 "name": { 12 "type": "string" 13 }, 14 "price": { 15 "type": "number" 16 }, 17 "tags": { 18 "type": "array", 19 "items": { 20 "type": "string" 21 } 22 }, 23 "dimensions": { 24 "type": "object", 25 "properties": { 26 "length": { 27 "type": "number" 28 }, 29 "width": { 30 "type": "number" 31 }, 32 "height": { 33 "type": "number" 34 } 35 } 36 }, 37 "warehouseLocation": { 38 "type": "object", 39 "properties": { 40 "latitude": { 41 "type": "number" 42 }, 43 "longitude": { 44 "type": "number" 45 } 46 } 47 } 48 }, 49 "required": [ 50 "id", 51 "name", 52 "price", 53 "dimensions", 54 "warehouseLocation" 55 ], 56 "title": "Product" 57 } 58}
g.generic(Object object)
Generates a generic schema from object
. Property types are described using primitives.
g.mysql([String tableName,] Mixed object)
Generates MySQL Table Schema from object
.
tableName
is optional, defaults to generic
object
must be of type Object
or Array
g.json([String title,] Mixed object)
Generates JSON Schema from object
.
title
is optionalobject
must be of type Object
or Array
g.mongoose(Object object)
Generates a Mongoose Schema from object
.
g.bigquery(Object object)
Generates a Google BigQuery schema from object
.
g.clickhouse([String tableName,] Mixed object, String dateField)
Generates ClickHouse Table Schema from object
.
tableName
is optional, defaults to generic
object
must be of type Object
or Array
dateField
Date field for ENGINE, must be of type Date
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 8/24 approved changesets -- score normalized to 3
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-06-09
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More