Gathering detailed insights and metrics for json2md
Gathering detailed insights and metrics for json2md
Gathering detailed insights and metrics for json2md
Gathering detailed insights and metrics for json2md
@types/json2md
TypeScript definitions for json2md
node-red-contrib-json2md
Parse json to markdown
@microfleet/schema2md
Converts parsed JsonSchema into `json2md` compatible datastructures.
smart-json2md
Convert plain JSON files to hierarchical Markdown documents with intelligent structuring
npm install json2md
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
614 Stars
180 Commits
84 Forks
12 Watchers
1 Branches
21 Contributors
Updated on Jul 11, 2025
Latest Version
2.0.3
Package Id
json2md@2.0.3
Unpacked Size
35.32 kB
Size
9.28 kB
File Count
6
NPM Version
10.9.2
Node Version
23.6.0
Published on
Apr 11, 2025
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
A JSON to Markdown converter.
If you're looking to use this on the client side, that's also possible. Check out the dist
directory.
1# Using npm 2npm install --save json2md 3 4# Using yarn 5yarn add json2md
1const json2md = require("json2md") 2 3console.log(json2md([ 4 { h1: "JSON To Markdown" } 5 , { blockquote: "A JSON to Markdown converter." } 6 , { img: [ 7 { title: "Some image", source: "https://example.com/some-image.png" } 8 , { title: "Another image", source: "https://example.com/some-image1.png" } 9 , { title: "Yet another image", source: "https://example.com/some-image2.png" } 10 ] 11 } 12 , { h2: "Features" } 13 , { ul: [ 14 "Easy to use" 15 , "You can programmatically generate Markdown content" 16 , "..." 17 ] 18 } 19 , { h2: "How to contribute" } 20 , { ol: [ 21 "Fork the project" 22 , "Create your branch" 23 , "Raise a pull request" 24 ] 25 } 26 , { h2: "Code blocks" } 27 , { p: "Below you can see a code block example." } 28 , { "code": { 29 language: "js" 30 , content: [ 31 "function sum (a, b) {" 32 , " return a + b" 33 , "}" 34 , "sum(1, 2)" 35 ] 36 } 37 } 38])) 39// => 40// # JSON To Markdown 41// > A JSON to Markdown converter. 42// 43//  44// 45//  46// 47//  48// 49// ## Features 50// 51// - Easy to use 52// - You can programmatically generate Markdown content 53// - ... 54// 55// ## How to contribute 56// 57// 1. Fork the project 58// 2. Create your branch 59// 3. Raise a pull request 60// 61// ## Code blocks 62// 63// Below you can see a code block example. 64// 65// ```js 66// function sum (a, b) { 67// return a + b 68// } 69// sum(1, 2) 70// ```
json2md(data, prefix)
Converts a JSON input to markdown.
Supported elements
Type | Element | Data | Example |
---|---|---|---|
h1 | Heading 1 | The heading text as string. | { h1: "heading 1" } |
h2 | Heading 2 | The heading text as string. | { h2: "heading 2" } |
h3 | Heading 3 | The heading text as string. | { h3: "heading 3" } |
h4 | Heading 4 | The heading text as string. | { h4: "heading 4" } |
h5 | Heading 5 | The heading text as string. | { h5: "heading 5" } |
h6 | Heading 6 | The heading text as string. | { h6: "heading 6" } |
p | Paragraphs | The paragraph text as string or array (multiple paragraphs). | { p: "Hello World"} or multiple paragraphs: { p: ["Hello", "World"] } |
blockquote | Blockquote | The blockquote as string or array (multiple blockquotes) | { blockquote: "Hello World"} or multiple blockquotes: { blockquote: ["Hello", "World"] } |
img | Image | An object or an array of objects containing the title , source and alt fields. | { img: { title: "My image title", source: "http://example.com/image.png", alt: "My image alt" } } |
ul | Unordered list | An array of strings or lists representing the items. | { ul: ["item 1", "item 2"] } |
ol | Ordered list | An array of strings or lists representing the items. | { ol: ["item 1", "item 2"] } |
hr | Separator | None | { hr: "" } |
code | Code block element | An object containing the language (String ) and content (Array or String ) fields. | { code: { "language": "html", "content": "<script src='dummy.js'></script>" } } |
table | Table | An object containing the headers (Array of String s) and rows (Array of Array s or Object s). | { table: { headers: ["a", "b"], rows: [{ a: "col1", b: "col2" }] } } or { table: { headers: ["a", "b"], rows: [["col1", "col2"]] } } |
link | Link | An object containing the title and the source fields. | { title: 'hello', source: 'https://ionicabizau.net' } |
You can extend the json2md.converters
object to support your custom types.
1json2md.converters.sayHello = function (input, json2md) { 2 return "Hello " + input + "!" 3}
Then you can use it:
1json2md({ sayHello: "World" }) 2// => "Hello World!"
data
: The input JSON data.prefix
: A snippet to add before each line.data
: The input JSON data.prefix
: A snippet to add before each line.There are few ways to get help:
Have an idea? Found a bug? See how to contribute.
I open-source almost everything I can, and I try to reply to everyone needing help using these projects. Obviously, this takes time. You can integrate and use these projects in your applications for free! You can even change the source code and redistribute (even resell it).
However, if you get some profit from this or just want to encourage me to continue creating stuff, there are few ways you can do it:
Starring and sharing the projects you like :rocket:
—I love books! I will remember you after years if you buy me one. :grin: :book:
—You can make one-time donations via PayPal. I'll probably buy a
coffee tea. :tea:
—Set up a recurring monthly donation and you will get interesting news about what I'm doing (things that I don't share with everyone).
Bitcoin—You can send me bitcoins at this address (or scanning the code below): 1P9BRsmazNQcuyTxEqveUsnf5CERdq35V6
Thanks! :heart:
If you are using this library in one of your projects, add it in this list. :sparkles:
@aligov/module-doc
@apica-io/asm-auto-deploy
@asyncapi/diff
@balmacefa/function_tool_kit
@best/github-integration
@best/store
@bonitasoft/dependency-list-to-markdown
@bwagener/gridsome-source-google-docs
@cloudcatalog/cli
@cloudcatalog/cli-test
@cobalt-engine/change-logger
@cypress/schema-tools
@dididc/dc-extension
@dlsl/hardhat-markup
@dschau/gatsby-source-google-docs
@e2y/bdd-dictionary-generator
@enrico.piccinin/gitlab-tools
@eventcatalog/plugin-doc-generator-asyncapi
@eventcatalog/utils
@eventcatalogtest/plugin-doc-generator-asyncapi
@feizheng/react-markdown-props
@flive/react-kit
@gigsboat/cli
@gracexwho/model-card-generator
@haimmag/schema-tools
@hankanman/postgres-to-docs
@hitorisensei/markdown-readme-generator
@hitorisensei/monorepo-readme-generator
@jswork/react-markdown-props
@klarna/postgres-to-docs
@lm_fe/scripts
@medyll/css-fabric-helper
@mfbtech/changelog-generator
@microfleet/schema2md
@mjefi/instags
@oasis-engine/oasis-run
@opas/plugin-doc
@r6d9/kol-tracker
@r6d9/kol_tracker
@s-ui/changelog
@servable/manifest
@servable/tools
@shelex/schema-tools
@sidneys/releasenotes
@solarity/hardhat-markup
@solarity/hardhat-migrate
@truto/truto-jsonata
@wii/swagger-plugin-transform-doc
@xygengcn/koa-api-docs
@yesand/asterism
bookmark2md
ccdown
chdown
chdown-workers
cli-demo3
cloudcastsdown
codexer
collman
component-docs-2md
cwq
dargstack_rgen
describe-dependencies
doc-cli
doc-vue
doc-vue3
dokuinjs
eddown
flawed-code-scanner
galaxy-vuepress-docs
gatsby-source-gdocs2md
gatsby-source-google-docs
gatsby-source-google-docs-sheets
gatsby-source-google-docs-team
git-diff-llm
github-repo-tools
gridsome-source-google-docs
heat-sfdx-tooling
joi-md-doc
jumia-travel-changelog
kbase-components
kindle-highlights
kol-tracker
kol_analyzer
lab-changelog
lambda-docs-2md
laradown
lbdoc-p
lggn
machine-ip
make-postgres-markdown
mcp-douban-server
merak-compile
mokker
msdown
my_ccdown
mysql-ksdb
node-red-contrib-json2md
notion2mdblog
npm-ex-xpi
p2doc
pantheon_site_management
parse-google-docs-json
platzi-virtual-machine
postgres-markdown
rap2doc
react-docgen-markdown
reposier
rober19-config
rush-archive-project-plugin
sfhdown
solidity-benchmark
tcdown
terraform2md
type-graphql-to-md
utterance-to-markdown
uxcore-tools
vue-md-gen
vue2markdown
work-webpack
I am using this library to generate documentation for my projects, being integrated with blah.No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
7 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 5
Reason
Found 5/11 approved changesets -- score normalized to 4
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
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-07-07
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