Registry / devops / json-docs-generator

json-docs-generator

JSON →
library1.5.1jsnpmunverified

A utility for generating Markdown documentation from JSON-based REST API descriptions. Current stable version is 1.5.1, with no active release cadence (last update unknown). Key differentiator: simple, declarative JSON schema to produce human-readable API docs without a heavy toolchain. Alternative to tools like Swagger/OpenAPI or apiDoc, but with a minimalist approach focused on REST endpoints, headers, request/response schemas, and error codes. Supports both local dev dependency and global CLI usage.

npm install json-docs-generator
INSTALL
IMPORT
SIG · JSON-DOCS-GENERATO
J
json-docs-generator
devopsjavascriptv1.5.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

generate-docs
npx generate-docs --input ./api.js --output ./docs.md
generate-docs --input ./api.js --output ./docs.md (if not installed globally)
CLI usage; package provides a binary, not a library import. Use npx or install globally.
package.json config
In package.json: {"scripts": {"docs": "generate-docs --input ./api.js --output ./docs.md"}}
Direct require or import in code (package is not designed as a library)
Package is intended as a CLI tool, not a programmatic API.

Shows how to define a basic REST API doc in a JavaScript config file and generate Markdown documentation using the CLI.

// Create api.js module.exports = { path: './docs.md', title: 'My API', description: 'Example API', baseUrl: 'https://api.example.com/v1', tags: { users: { title: 'Users' }, }, endpoints: { '/users': { get: { title: 'List users', tags: ['users'], headers: ['Authorization: Bearer token'], response: { id: 'number', name: 'string' }, errors: { 401: 'Unauthorized', 500: 'Internal server error' }, }, }, }, }; // Then run: npx generate-docs --input ./api.js --output ./docs.md
Debug
Known issues
gotchaPackage is not a library and has no programmatic API. Attempting to require('json-docs-generator') will not export a usable function.
fix
Use the CLI command 'generate-docs' via npx or global install.
affects: >=1.0.0
gotchaThe 'path' in the config file must be a writable path relative to the current working directory. Does not support absolute paths.
fix
Use a relative path like './docs.md' as the 'path' value.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'json-docs-generator'
Attempting to require the package programmatically, but it only provides a CLI binary.
fix
Use the command line: npx generate-docs --input ./api.js --output ./docs.md
ENOENT: no such file or directory, open 'api.js'
The --input file path does not exist or is incorrect.
fix
Ensure the input file exists and provide the correct relative path.
Upgrade
Version history
1.5.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
9 hits · last 30 days
node
8
Amazon
1
Resources
json-docs-generator — npm install json-docs-generator · libregistry