{"id":17119849,"url":"https://github.com/xiaofuzi/mdtojson","last_synced_at":"2025-07-29T02:07:10.052Z","repository":{"id":57293696,"uuid":"83106165","full_name":"xiaofuzi/mdToJson","owner":"xiaofuzi","description":"parse md files to json","archived":false,"fork":false,"pushed_at":"2017-02-25T09:16:18.000Z","size":621,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-26T04:38:20.488Z","etag":null,"topics":["markdown","parser"],"latest_commit_sha":null,"homepage":null,"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/xiaofuzi.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}},"created_at":"2017-02-25T04:31:07.000Z","updated_at":"2022-03-18T17:02:54.000Z","dependencies_parsed_at":"2022-09-01T08:40:40.888Z","dependency_job_id":null,"html_url":"https://github.com/xiaofuzi/mdToJson","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/xiaofuzi/mdToJson","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaofuzi%2FmdToJson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaofuzi%2FmdToJson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaofuzi%2FmdToJson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaofuzi%2FmdToJson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xiaofuzi","download_url":"https://codeload.github.com/xiaofuzi/mdToJson/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaofuzi%2FmdToJson/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267617643,"owners_count":24116208,"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","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["markdown","parser"],"created_at":"2024-10-14T17:58:18.179Z","updated_at":"2025-07-29T02:07:10.026Z","avatar_url":"https://github.com/xiaofuzi.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## mds-to-json\n\nparse md files to json.\n\n* usage\n\n```bash\nnpm install\n```\n\n* test\n\n```bash\nnpm run test\n```\n\nexample:\n\n```js\nvar mdToJson = require('../src/index.js'),\n    path = require('path');\n\nlet {\n    parsedFiles\n} = mdToJson({});\n\nvar res = parsedFiles(path.join(__dirname, './_posts'));\nconsole.log(res.total);\nconsole.log(res.data[0].meta);\nconsole.log(res.data[0].summary);\nconsole.log(res.data[0].content);\n```\n\n### output\n\n* res\n    `type: Object`\n\n```js\nvar res = {\n    total: 10,\n    data: [\n        {\n            meta:{ title: '简单的dom库和轻量级mvvm框架的尝试',\n            date: 2016-02-21T19:07:19.000Z,\n            tags: [ 'js' ],\n            id: '0',\n            createTime: '2016-02-22',\n            url: '2016-02-22-简单的dom库和轻量级mvvm框架的尝试',\n            strTag: 'js' }\n        }\n    ]\n}\n```\n\n### API\n\n* parseFiles | `Function`\n\n    return parsed data by json.\n    按 json 格式返回处理后的数据.\n\n* use\n    add a plugin\n\n* parse\n    * params\n        * marked: `Object`  marked options\n        * dirname: 'String' the soure dirname\n\n    parse file use plugin\n\n* plugins\n\nexamples:\n\n```javascript\nvar mdToJson = require('mds-to-json')();\n\nmdToJson.use((res, next)=\u003e{\n    console.log(res.total);\n\n    next(res);\n})\n\nmdToJson.use('printTotal', (res, next)=\u003e{\n    console.log(res.total);\n\n    next(res);\n})\n\nmdToJson.parse((res)=\u003e{\n    console.log(res);\n})\n```\n\n## who used?\n\n[ssr-web(A fast, simple \u0026 powerful blog framework, powered by Node.js and Vue.)](https://github.com/xiaofuzi/ssr-web)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxiaofuzi%2Fmdtojson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxiaofuzi%2Fmdtojson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxiaofuzi%2Fmdtojson/lists"}