{"id":13941726,"url":"https://github.com/scottstanfield/markdown-to-json","last_synced_at":"2025-05-15T08:03:48.152Z","repository":{"id":7510639,"uuid":"8860833","full_name":"scottstanfield/markdown-to-json","owner":"scottstanfield","description":"🕹️ Convert YAML front-matter in Markdown files to JSON. v0.5.1 is published on NPM. Current version is v0.6.0","archived":false,"fork":false,"pushed_at":"2025-02-19T20:01:53.000Z","size":212,"stargazers_count":262,"open_issues_count":7,"forks_count":56,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-05-02T12:51:56.120Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scottstanfield.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-03-18T18:16:42.000Z","updated_at":"2025-04-04T13:01:29.000Z","dependencies_parsed_at":"2025-04-11T05:01:27.650Z","dependency_job_id":null,"html_url":"https://github.com/scottstanfield/markdown-to-json","commit_stats":{"total_commits":70,"total_committers":16,"mean_commits":4.375,"dds":0.7857142857142857,"last_synced_commit":"1f672307ae360fcd0abbae1e0dfe5caba46e8e6e"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scottstanfield%2Fmarkdown-to-json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scottstanfield%2Fmarkdown-to-json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scottstanfield%2Fmarkdown-to-json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scottstanfield%2Fmarkdown-to-json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scottstanfield","download_url":"https://codeload.github.com/scottstanfield/markdown-to-json/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253924335,"owners_count":21985090,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-08T02:01:26.253Z","updated_at":"2025-05-15T08:03:48.090Z","avatar_url":"https://github.com/scottstanfield.png","language":"JavaScript","funding_links":[],"categories":["others","JavaScript"],"sub_categories":[],"readme":"# markdown-to-json\n\n![](https://img.shields.io/github/v/release/scottstanfield/markdown-to-json)\n\nTool for converting YAML Front Matter in Markdown files to JSON files.\n\n`m2j` is used to read a folder of Markdown files, pulling out the YAML\nFront Matter from each, and saving it all as a JSON blob.\n\nThis is especially useful if you have a folder full of Markdown files\nthat you want scanned and processed into a single JSON file, which can\nthen be consumed by Angular on the client, cached in a Node server, or\nsaved in a NoSQL database.\n\nIn addition to moving the YAML to JSON, a few extra elements are created: \n\n-  `iso8601` [formatted][1] timestamp from `date` using [Moment.js][2]\n-  `preview` is the first 70 or so characters of the actual raw Markdown content, with ellipses at the end\n-  `basename` is the filename without the path or extension\n-  `content` is created only if the content flag is enabled; raw Markdown content will be unabridged\n\n_Example_\n\n```\n% m2j --help\n\n  Usage: m2j [options] \u003cfiles\u003e\n\n  Options:\n\n    -h, --help               output usage information\n    -V, --version            output the version number\n    -w --width \u003cint\u003e         max width of preview text [70]. Set to 0 for no preview.\n    -p --pretty              format JSON with newlines\n    -c --content             include the full content of the file unabridged\n    -o --outfile \u003cfilename\u003e  filename to save json to [output.json]\n\n\n% m2j.js lottery.md\n```\n\n**lottery.md**\n\n```md\n---\ntitle: The Lottery Ticket\nauthor: Anton C.\ndate: \"2013-03-15 15:00\"\ntemplate: article.jade\ntags:\n  - Fiction\n  - Russian\n\n---\n\nIvan Dmitritch, a middle-class man who lived with his family on an income of twelve hundred a year and was very well satisfied with his lot, sat down on the sofa after supper and began reading the newspaper. \n\n```\n\n**output**\n\n```js\n{\n  \"files\": [\n    {\n      \"title\": \"The Lottery Ticket\",\n      \"author\": \"Anton C.\",\n      \"date\": \"1893-04-01\",\n      \"template\": \"article.jade\",\n      \"tags\": [\n        \"Fiction\",\n        \"Russian\"\n      ],\n      \"preview\": \"Ivan Dmitritch, a middle-class man who lived with his family on an …\",\n      \"iso8601Date\": \"1893-04-01T00:00:00-07:00\",\n      \"basename\": \"lottery.md\"\n    }\n  ]\n}\n```\n\n\n[1]: https://en.wikipedia.org/wiki/ISO_8601\n[2]: http://momentjs.com/docs/#/parsing/string/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscottstanfield%2Fmarkdown-to-json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscottstanfield%2Fmarkdown-to-json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscottstanfield%2Fmarkdown-to-json/lists"}