@pioneer10/markdown-replace-section
v1.0.1
Published
Replace a section in a Markdown file with different content
Downloads
14
Readme
markdown-replace-section
Replace a section in a Markdown file with different content.
Installation
npm install --save markdown-replace-section
Usage
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
License
See LICENSE