I have changelog.MD file I am reading it through, fs in JavaScript like,
const readFile = async (fileName: string) => {
return promisify(fs.readFile)(filePath, 'utf8');
}
now reading my .md file:
const readMD = async (filePath: string) => {
const text = await readFile(filePath);
}
content in changelog.md is:
## asdfasdf
* 11asdf asdf
* 11asdfadf
## asdfadf
* asdfasf
* asdfasdf
function to read it and applying regex like:
const changeLog = await readME(changeLogPath);
const result = changelog.match(/^##.*\n([^#]*)/m);
console.log(final[1]);
btw- this regex is working fine and returns me the first bullets under first ##. ie. output.
* 11asdf asdf
* 11asdfadf
but it returns null, when I apply it on the result after reading changelog.MD file. Any help.