{"id":15598192,"url":"https://github.com/boneskull/markdown-toc-index","last_synced_at":"2025-03-26T03:31:58.747Z","repository":{"id":32459209,"uuid":"36038834","full_name":"boneskull/markdown-toc-index","owner":"boneskull","description":null,"archived":true,"fork":false,"pushed_at":"2016-11-23T20:46:09.000Z","size":29,"stargazers_count":3,"open_issues_count":21,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-12T09:24:39.862Z","etag":null,"topics":[],"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/boneskull.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":"2015-05-21T21:44:09.000Z","updated_at":"2024-11-19T20:02:25.000Z","dependencies_parsed_at":"2022-08-24T12:30:41.059Z","dependency_job_id":null,"html_url":"https://github.com/boneskull/markdown-toc-index","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boneskull%2Fmarkdown-toc-index","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boneskull%2Fmarkdown-toc-index/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boneskull%2Fmarkdown-toc-index/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boneskull%2Fmarkdown-toc-index/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/boneskull","download_url":"https://codeload.github.com/boneskull/markdown-toc-index/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245585200,"owners_count":20639667,"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-10-03T01:29:58.735Z","updated_at":"2025-03-26T03:31:58.225Z","avatar_url":"https://github.com/boneskull.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# markdown-toc-index\n\nBuilds an index of Markdown files.\n\nThis node module is a lib and command line tool that traverses a given directory for all markdown files (with extension `.md`) and compiles all of their tables of contents into one giant markdown string. All the tables of contentses!\n\n*This is a fork of package [markdown-index](https://www.npmjs.com/package/markdown-index).*\n\n## Usage\n\n### Command Line Interface\n\n```\nWrites an index for a directory fulla Markdown files to STDOUT.\n\nUsage: toc-idx [options] [directory-or-glob]\n\nOptions:\n  --inject, -i   Do not output to STDOUT; instead, inject TOC into file at\n                 range marked by \"\u003c!-- INDEX --\u003e...\u003c!-- /INDEX --\u003e\".  Mutually\n                 exclusive with \"--output\"\n  --exclude, -x  Exclude a glob.  Injected file (if any) and node_modules/ are\n                 excluded by default\n  --output, -o   Do not write to SDTOUT; instead, write to file.  Mutually\n                 exclusive with \"--inject\"\n  --help, -h     Show help\n  --version, -v  Show version number\n\nExamples:\n  toc-idx --inject README.md docs/       Inject an index of all *.md files\n                                         within docs/ and its subdirectories\n                                         into README.md\n  toc-idx --output INDEX.md docs/*.md    Output the index of files matching\n                                         glob docs/*.md to new file INDEX.md\n```\n\n### Programmatic\n\nThe main function can be imported programmatically:\n\n```js\nvar mdTocIdx = require('markdown-toc-index');\n\nmdTocIdx(some_directory, function(err, index) {\n  // do stuff with output string \"index\"\n});\n```\n\nIn addition, an `inject()` function is available, which will work like the `--inject` option noted above:\n\n```js\nvar mdTocIdx = require('markdown-toc-index');\n\nmdTocIdx(some_directory, function(err, index) {\n  mdTocIdx.inject('my-file.md', index, function(err) {\n    // done\n  });\n});\n```\n\n## Installation\n\nFor command-line usage, you may want to install globally:\n\n```shell\n$ npm install -g markdown-toc-index\n```\n\nFor programmatic usage, install locally:\n\n```shell\n$ npm install markdown-toc-index\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboneskull%2Fmarkdown-toc-index","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fboneskull%2Fmarkdown-toc-index","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboneskull%2Fmarkdown-toc-index/lists"}