New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

widdershins-reborn

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

widdershins-reborn

Convert OpenAPI / Swagger / AsyncAPI / Semoasa definitions to Markdown or HTML — for apps, docs pipelines, and static site generators

latest
Source
npmnpm
Version
0.1.5
Version published
Weekly downloads
3
-85%
Maintainers
1
Weekly downloads
 
Created
Source

widdershins-reborn

The maintained OpenAPI-to-Markdown converter. Convert OpenAPI 3.0/3.1, Swagger 2.0, AsyncAPI 1.x/2.x, and Semoasa definitions into clean Markdown or HTML documentation — for Slate, Redoc, ReSpec, or any static site generator.

npm version npm downloads Socket Badge License: MIT Node.js GitHub Actions

Why widdershins-reborn?

widdershins was the go-to OpenAPI-to-Markdown tool but has been unmaintained since 2020. It doesn't work with Node 20+, has known security vulnerabilities, and lacks ESM/TypeScript support.

widdershins-reborn picks up where widdershins left off:

widdershinswiddershins-reborn
Last updated20202026
Node.js8–1420+
ESM supportNoYes
TypeScript typesNoYes
OAS 3.1NoYes (type arrays, const, nullable)
AsyncAPI 2.xNoYes
DockerNoYes
cleanMarkdownNoYes (pure markdown output)
Security13+ known vulns0 vulnerabilities
MaintainedNoYes

Install

npm install widdershins-reborn

Or use Docker:

docker run --rm -v $(pwd):/app widdershins-reborn /app/api.json -o /app/docs.md

Quick Start (JavaScript)

const widdershins = require('widdershins-reborn');
const fs = require('fs');

// Load your OpenAPI/Swagger/AsyncAPI definition
const api = JSON.parse(fs.readFileSync('petstore.json', 'utf8'));

// Convert to Markdown
widdershins
  .convert(api, {
    search: true,
    sample: true,
    language_tabs: [{ javascript: 'JavaScript' }, { python: 'Python' }],
  })
  .then(markdown => {
    fs.writeFileSync('api-docs.md', markdown, 'utf8');
    console.log('Documentation generated!');
  })
  .catch(err => {
    console.error('Conversion failed:', err);
  });

Quick Start (ESM / Modern Node)

import widdershins from 'widdershins-reborn';
import { readFileSync } from 'fs';

const api = JSON.parse(readFileSync('petstore.json', 'utf8'));

const markdown = await widdershins.convert(api, {
  search: true,
  sample: true,
});

console.log(markdown);

Pure Markdown Output

Use cleanMarkdown: true to get clean, publish-ready markdown with no HTML tags, a generated TOC, and YAML frontmatter:

const markdown = await widdershins.convert(api, {
  cleanMarkdown: true,
  sample: true,
  language_tabs: [],
});

This will:

  • Convert all HTML headings/links to markdown
  • Strip placeholder JSON sample blocks
  • Generate a table of contents
  • Add YAML frontmatter with API metadata (title, version, servers, stats)
  • Normalize heading hierarchy (title=h1, sections=h2, operations=h3)

Use omitHeader: true to skip the YAML frontmatter while keeping other cleanups.

API Reference

widdershins.convert(api, options)

Converts an API definition to Markdown. Returns a Promise<string>.

Parameters:

NameTypeDescription
apiobject | stringParsed OpenAPI/Swagger/AsyncAPI object, or a string (for API Blueprint)
optionsobjectConversion options (see below)

Options:

OptionTypeDefaultDescription
searchbooleantrueInclude search in output
samplebooleantrueGenerate example values (false = raw schemas)
codeSamplesbooleanfalseInclude generated code samples
httpsnippetbooleanfalseUse httpsnippet for code generation
language_tabsarray[]Language tabs: [{ javascript: 'JavaScript' }]
language_clientsarray[]Client libraries: [{ shell: 'curl' }]
themestring'darkula'Syntax highlighting theme
discoverybooleanfalseInclude schema.org WebAPI discovery data
headingsnumber2Heading depth for TOC
tocSummarybooleanfalseUse operation summary in TOC
shallowSchemasbooleanfalseDon't expand $ref schemas
expandBodybooleanfalseExpand request body schemas
maxDepthnumber10Max depth for schema examples
yamlbooleanfalseDisplay schemas in YAML format
resolvebooleanfalseResolve external $refs
sourcestring—Base URL for resolving refs
includesstring[][]Files to include in output
user_templatesstring—Directory with custom doT.js templates
templateCallbackfunction—Called before/after each template
htmlbooleanfalseOutput HTML instead of Markdown
respecobject—ReSpec config object (implies html)
clipboardbooleantrueInclude clipboard support
customApiKeyValuestring'ApiKey'Custom API key for code samples
omitBodybooleanfalseOmit body param from table
omitHeaderbooleanfalseOmit YAML front-matter
useBodyNamebooleanfalseUse original param name for OAS2 body
verbosebooleanfalseVerbose output
experimentalbooleanfalseUse experimental features
cleanMarkdownbooleanfalsePost-process to pure markdown (HTML→md, strip placeholder JSON, generate TOC & frontmatter)
rawbooleanfalseOutput raw schemas instead of examples
toc_footersarray[]Footer links for TOC

Template Callback

The templateCallback option lets you hook into template rendering:

widdershins.convert(api, {
  templateCallback: (templateName, stage, data) => {
    // stage is 'pre' or 'post'
    console.log(`${stage} rendering: ${templateName}`);
    return data; // must return data
  },
});

Supported Input Formats

FormatVersionsNotes
OpenAPI3.0.x, 3.1.xFull support (3.1: type arrays, const, nullable)
Swagger2.0Auto-converted to OAS3 internally
AsyncAPI1.x, 2.xTopics/messaging APIs
Semoasa0.1.0OpenAPI Extension Format
API Blueprint—Passthrough (already Markdown)

Supported Output Formats

FormatUse With
MarkdownSlate, ReSlate, Shins
HTMLReSpec, custom doc sites

CLI Usage

The CLI is available but the library API is recommended for app integration:

npx widdershins-reborn [options] {input-file|url} [[-o] output-markdown]
widdershins-reborn --search false --language_tabs 'python:Python' api.json -o docs.md

Validate an API definition without generating output:

widdershins-reborn --validate api.json

Run widdershins-reborn --help for all options.

Custom Templates

Override the default doT.js templates by passing a directory:

widdershins.convert(api, {
  user_templates: './my-templates',
});

Template docs:

Docker

Run without installing Node.js — Docker is the only dependency:

docker run --rm -v $(pwd):/app widdershins-reborn api.json -o /app/docs.md

With options:

docker run --rm \
  -v $(pwd):/app \
  widdershins-reborn \
  /app/api.json \
  --search false \
  --cleanMarkdown \
  --language_tabs 'python:Python' \
  -o /app/docs.md

Build locally:

docker build . -t widdershins-reborn

Tests

npm test

Publishing

npmjs.org:

npm publish

GitHub Packages:

  • Create a personal access token with write:packages scope
  • Add to your global ~/.npmrc:
    //npm.pkg.github.com/:_authToken=YOUR_TOKEN
    
  • Add to your project .npmrc:
    @sikandarsubhani:registry=https://npm.pkg.github.com
    
  • Publish (GitHub Packages requires a scoped name):
    npm pkg set name='@sikandarsubhani/widdershins-reborn'
    npm publish --registry=https://npm.pkg.github.com --access=public
    npm pkg set name='widdershins-reborn'
    

Migrating from widdershins

Drop-in replacement — just change the package name:

npm uninstall widdershins
npm install widdershins-reborn
- const widdershins = require('widdershins');
+ const widdershins = require('widdershins-reborn');
- "widdershins": "^3.0.0"
+ "widdershins-reborn": "^0.1.4"

The API is identical. New options available:

widdershins.convert(api, {
  cleanMarkdown: true,  // new: pure markdown output
  // ...all existing options still work
});

Who uses widdershins-reborn?

widdershins-reborn is used for generating API documentation from OpenAPI, Swagger, and AsyncAPI specs in:

  • Static doc sites — Slate, Redoc, ReDocly, custom generators
  • CI/CD pipelines — automated doc generation on spec changes
  • Node.js apps — runtime markdown generation (Next.js, Express, Fastify)
  • Docker pipelines — zero-dependency doc builds
  • Microservices — event-driven API docs from AsyncAPI

Comparison with alternatives

ToolInput FormatsOutputLibrary APIDockerMaintained
widdershins-rebornOAS 3.0/3.1, Swagger 2.0, AsyncAPI 1.x/2.x, SemoasaMarkdown, HTMLYesYesYes
redocOpenAPI 3.xHTML onlyYesYesYes
swagger-uiOpenAPI 3.x, Swagger 2.0HTML onlyYesYesYes
openapi-to-mdOpenAPI 3.xMarkdownYesNoNo
openapi-diffOpenAPI 3.xDiff onlyYesNoNo

Credits

License

MIT — Original work Copyright (c) 2016 Mermade Software, fork maintained by Sikandar.

Keywords

openapi

FAQs

Package last updated on 27 Jul 2026

Related posts