{"_id":"json-schema-doc-ts","name":"json-schema-doc-ts","dist-tags":{"latest":"2.0.0"},"versions":{"2.0.0":{"name":"json-schema-doc-ts","author":{"name":"Brian Wendt","url":"https://github.com/BrianWendt"},"description":"Generate documentation for JSON Schemas","main":"./src/main.js","type":"module","keywords":["json","schema","documentation","markdown","json-schema"],"version":"2.0.0","license":"SEE LICENSE IN LICENSE","repository":{"type":"git","url":"git+https://github.com/OntoDevelopment/json-schema-doc-ts.git"},"bugs":{"url":"https://github.com/OntoDevelopment/json-schema-doc-ts/issues"},"scripts":{"build":"tsc && prettier . --write","lint":"eslint"},"homepage":"https://github.com/OntoDevelopment/json-schema-doc-ts","public":true,"devDependencies":{"@eslint/js":"^9.22.0","eslint":"^9.22.0","globals":"^16.0.0","prettier":"3.5.3","typescript-eslint":"^8.26.1"},"dependencies":{"acorn":"^8.14.1","acorn-jsx":"^5.3.2","ajv":"^6.12.6","ansi-styles":"^4.3.0","argparse":"^2.0.1","balanced-match":"^1.0.2","brace-expansion":"^1.1.11","braces":"^3.0.3","callsites":"^3.1.0","chalk":"^4.1.2","color-convert":"^2.0.1","color-name":"^1.1.4","concat-map":"^0.0.1","cross-spawn":"^7.0.6","debug":"^4.4.0","deep-is":"^0.1.4","escape-string-regexp":"^4.0.0","eslint-scope":"^8.3.0","eslint-visitor-keys":"^4.2.0","espree":"^10.3.0","esquery":"^1.6.0","esrecurse":"^4.3.0","estraverse":"^5.3.0","esutils":"^2.0.3","fast-deep-equal":"^3.1.3","fast-glob":"^3.3.3","fast-json-stable-stringify":"^2.1.0","fast-levenshtein":"^2.0.6","fastq":"^1.19.1","file-entry-cache":"^8.0.0","fill-range":"^7.1.1","find-up":"^5.0.0","flat-cache":"^4.0.1","flatted":"^3.3.3","glob-parent":"^6.0.2","graphemer":"^1.4.0","has-flag":"^4.0.0","ignore":"^5.3.2","import-fresh":"^3.3.1","imurmurhash":"^0.1.4","is-extglob":"^2.1.1","is-glob":"^4.0.3","is-number":"^7.0.0","isexe":"^2.0.0","js-yaml":"^4.1.0","json-buffer":"^3.0.1","json-schema-traverse":"^0.4.1","json-stable-stringify-without-jsonify":"^1.0.1","keyv":"^4.5.4","levn":"^0.4.1","locate-path":"^6.0.0","lodash.merge":"^4.6.2","merge2":"^1.4.1","micromatch":"^4.0.8","minimatch":"^3.1.2","ms":"^2.1.3","natural-compare":"^1.4.0","optionator":"^0.9.4","p-limit":"^3.1.0","p-locate":"^5.0.0","parent-module":"^1.0.1","path-exists":"^4.0.0","path-key":"^3.1.1","picomatch":"^2.3.1","prelude-ls":"^1.2.1","punycode":"^2.3.1","queue-microtask":"^1.2.3","resolve-from":"^4.0.0","reusify":"^1.1.0","run-parallel":"^1.2.0","semver":"^7.7.1","shebang-command":"^2.0.0","shebang-regex":"^3.0.0","strip-json-comments":"^3.1.1","supports-color":"^7.2.0","to-regex-range":"^5.0.1","ts-api-utils":"^2.0.1","type-check":"^0.4.0","typescript":"^5.8.2","uri-js":"^4.4.1","which":"^2.0.2","word-wrap":"^1.2.5","yocto-queue":"^0.1.0"},"_id":"json-schema-doc-ts@2.0.0","gitHead":"6e4dbd6b48810868440f79fa726a050dff9e4cda","_nodeVersion":"20.16.0","_npmVersion":"10.8.1","dist":{"integrity":"sha512-lgLJcrB6dQ4voTUw0OkuDCu6joy2MzpuimezF07AwCKuEpKTmwVadCHurf29e14Zse1WlySKMw6JDURTh1U7OQ==","shasum":"2733cf267a4eff3bb0d8a518896050a3d086d09b","tarball":"https://registry.npmjs.org/json-schema-doc-ts/-/json-schema-doc-ts-2.0.0.tgz","fileCount":16,"unpackedSize":94966,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC1gc2913cHUFQ9Hkw1aQ+3uIPRFaqQUEJ1g8nijVp+5gIgG+kYh26cpMXqqVKnXzVst9IeQC/luiBai4yt0IC/Bdo="}]},"_npmUser":{"name":"ontodevelopment","email":"brian@ontodevelopment.com"},"directories":{},"maintainers":[{"name":"ontodevelopment","email":"brian@ontodevelopment.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/json-schema-doc-ts_2.0.0_1742187688540_0.03697253118797361"},"_hasShrinkwrap":false}},"time":{"created":"2025-03-17T05:01:28.539Z","2.0.0":"2025-03-17T05:01:28.770Z","modified":"2025-03-17T05:01:29.036Z"},"maintainers":[{"name":"ontodevelopment","email":"brian@ontodevelopment.com"}],"description":"Generate documentation for JSON Schemas","homepage":"https://github.com/OntoDevelopment/json-schema-doc-ts","keywords":["json","schema","documentation","markdown","json-schema"],"repository":{"type":"git","url":"git+https://github.com/OntoDevelopment/json-schema-doc-ts.git"},"author":{"name":"Brian Wendt","url":"https://github.com/BrianWendt"},"bugs":{"url":"https://github.com/OntoDevelopment/json-schema-doc-ts/issues"},"license":"SEE LICENSE IN LICENSE","readme":"# json-schema-doc-ts\n\n**NOTE:** This module supports [json-schema.org](https://json-schema.org/) `draft-7`. Previous drafts may not generate documentation correctly.\n\n## Generate markdown documentation for JSON Schemas\n\n[Click here](https://github.com/BrianWendt/json-schema-md-doc/tree/master/samples/node) to see the Node example.\n\nIf you just need to quickly create markdown from a JSON schema, use the [online tool](https://brianwendt.github.io/json-schema-md-doc/).\n\n### Simple Implementation\n\n**es6 and later**\n\n```\nnpm install json-schema-doc-ts\n```\n\n```javascript\nimport { JSONSchemaMarkdownDoc } from \"json-schema-doc-ts\";\n\n// simple schema for the example\nconst colors_schema = {\n    description: \"Choose a color\",\n    type: \"string\",\n    enum: [\"red\", \"amber\", \"green\"],\n};\n\n// create an instance of JSONSchemaMarkdownDoc and load the schema\nconst Doccer = new JSONSchemaMarkdownDoc(colors_schema);\n// generate the markdown\nconsole.log(Doccer.generate());\n```\n\n**Result**\n\n```markdown\n_Choose a color_\n\nType: `string`\n\n_path: #_\n\nThe value is restricted to the following:\n\n1.  _\"red\"_\n2.  _\"amber\"_\n3.  _\"green\"_\n\n_Generated with [OntoDevelopment/json-schema-doc-ts](https://github.com/OntoDevelopment/json-schema-doc-ts)_\n```\n\n### Extendabale\n\nYou may easily extend `JSONSchemaMarkdownDoc` to customize the formatting of your markdown by overriding any method.\n\n```typescript\nimport { JSONSchemaMarkdownDoc } from \"json-schema-doc-ts\";\n\nclass MyDoccer extends JSONSchemaMarkdownDoc {\n    footer = \"Thanks for reading the documentation!\";\n    valueBool(bool: boolean | string) {\n        if (typeof bool === \"string\") {\n            return bool;\n        } else {\n            return bool ? \"TRUE\" : \"FALSE\"; //uppercase instead of true/false\n        }\n    }\n}\n```\n\n## Generate documentation in other formats for JSON Schemas\n\nThis project may add a JSONSchemaHtmlDoc (JSON Schema to HTML documentation) class in the future. This is a small sample of what that might look like.\n\n```typescript\nimport { JSONSchemaDocAbstract } from \"json-schema-doc-ts\";\n\nclass JSONSchemaHtmlDoc extends JSONSchemaDocAbstract {\n    writeLine(text: string = \"\", level: number = 1): this {\n        this.response += '<p style=\"padding-left: ' + level + 'em\">' + text + \"</p>\";\n        return this;\n    }\n    // ...\n}\n```\n","readmeFilename":"README.md","_rev":"1-6061035bf1f1d9b0dd2ab4653929c02e"}