1.0.1 • Published 2 years ago

@pioneer10/markdown-replace-section v1.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

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

1.0.1

2 years ago

1.0.0

2 years ago