Replace a section in a Markdown file with different content.
npm install --save markdown-replace-section
Code
import replaceSection from "markdown-replace-section";
const markdown =
`
Title
=====
Old content
Other title
===========
Some other content
`;
const hungry = true; // Set to false to keep the Subtitle section
console.log(replaceSection(markdown, "Title", "New content", hungry));
Output
Title
=====
New content
Other title
===========
Some other content
See LICENSE