Check out example codes for "npm md to html". It will help you in understanding the concepts better.

Code Example 1

import md2html from 'md-to-html'; const promise = md2html('foo.md', 'bar.html', {    breaks: true,    maxdepth: 2,    title: 'page-title'});

Learn ReactJs, React Native from akashmittal.com