@freephoenix888/generate-table-of-contents-for-markdown
TypeScript icon, indicating that this package has built-in type declarations

4.0.13 • Public • Published

npm Gitpod

Generates table of contents for markdown

Table Of Contents

Quick Start

  • Add the following to your README.md
    <!-- TABLE_OF_CONTENTS_START -->
    <!-- TABLE_OF_CONTENTS_END -->
  • Run this javascript code
    import {readFileSync, writeFileSync} from 'fs';
    import {generateUsageWaysOfNpmCliApps} from '@freephoenix888/generate-table-of-contents-for-markdown';
    
    const generatedUsageWays = generateTableOfContentsForMarkdown({
      markdownFilePath,
      output: {
        writeMode: 'replace-placeholder',
        placeholder: {
          start: `<!-- TABLE_OF_CONTENTS_START -->`,
          end: `<!-- TABLE_OF_CONTENTS_END -->`,
        },
        filePath: 'README.md'
      }
    });
    console.log(generatedUsageWays)

Library

See Documentation for examples and API

Package Sidebar

Install

npm i @freephoenix888/generate-table-of-contents-for-markdown

Weekly Downloads

8

Version

4.0.13

License

Unlicense

Unpacked Size

7.1 kB

Total Files

6

Last publish

Collaborators

  • freephoenix888