{"id":18356506,"url":"https://github.com/lbwa/mark-to-json","last_synced_at":"2025-09-02T23:33:38.674Z","repository":{"id":96822264,"uuid":"145523032","full_name":"lbwa/mark-to-json","owner":"lbwa","description":":truck: Parse the markdown into a JSON static file.","archived":false,"fork":false,"pushed_at":"2018-08-26T02:36:01.000Z","size":31,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-04-30T04:04:06.768Z","etag":null,"topics":["json","markdown-parser","markdown-parsing","markdown-to-json","parser","static","static-files"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/lbwa.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2018-08-21T07:18:11.000Z","updated_at":"2018-09-05T10:05:24.000Z","dependencies_parsed_at":"2023-03-21T01:33:29.682Z","dependency_job_id":null,"html_url":"https://github.com/lbwa/mark-to-json","commit_stats":{"total_commits":19,"total_committers":1,"mean_commits":19.0,"dds":0.0,"last_synced_commit":"7e2c8428a4160783e340403209bc27c3722881df"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lbwa%2Fmark-to-json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lbwa%2Fmark-to-json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lbwa%2Fmark-to-json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lbwa%2Fmark-to-json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lbwa","download_url":"https://codeload.github.com/lbwa/mark-to-json/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248142709,"owners_count":21054666,"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":["json","markdown-parser","markdown-parsing","markdown-to-json","parser","static","static-files"],"created_at":"2024-11-05T22:10:29.715Z","updated_at":"2025-04-10T01:48:59.997Z","avatar_url":"https://github.com/lbwa.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mark-to-json [![NpmVersion](https://img.shields.io/npm/v/mark-to-json.svg?style=flat-square)](https://www.npmjs.com/package/mark-to-json) [![NodeVersion](https://img.shields.io/node/v/mark-to-json.svg?style=flat-square)](https://www.npmjs.com/package/mark-to-json)\n\n\u003e Parse the markdown into a JSON static file, also support multiple-level directories.\n\n## Installing\n\n```bash\n# npm\nnpm i mark-to-json --save\n\n# yarn\nyarn add mark-to-json\n```\n\n## Usage\n\n| API | Required | default | Description |\n| --- | -------- | ------- | ----------- |\n| token | true | | Your markdown file content including yaml matter |\n| dest | false | `./default.json` | Your JSON static file will be created at the place based on the current nodejs working path |\n| extraHeader | false | `{}` | It will be mix in JSON file if you want to add some extra data to JSON static file |\n| contentKey | false | `content` | It will be the key of markdown content part in JSON static file |\n| filter | false || It can be used to change output schema ([sample][filter-sample]). |\n\n[filter-sample]:./samples/index.ts\n\n## Sample\n\n```js\nconst Mtj = require('mark-to-json')\n\nnew Mtj({\n  token: '---\\ntitle: Hello world\\n---\\nThis is content.',\n  dest: './writings/hello-world.json',\n  extraHeader: {\n    errno: 0\n  },\n  contentKey: 'content',\n\n  // Only work with one parameter: schema\n  filter (schema) {\n    // do something\n    // `return` is optional\n  }\n})\n\n// You can find your json file at the './writings/hello-world.json' based on the current nodejs working path\n```\n\nThe sample output file: [here]\n\n[here]:https://github.com/lbwa/mark-to-json/tree/master/samples/nested\n\n## Changelog\n\n[Changelog](./CHANGELOG.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flbwa%2Fmark-to-json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flbwa%2Fmark-to-json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flbwa%2Fmark-to-json/lists"}