Simple nodejs module that collects all comments from input html. Optionally filter out everything that begins with a given keyword.
npm install html-commentsjs
var htmlcomments = require('html-comments');var options = {
keyword: 'yep', // keyword to filter comments with
removeKeyword: true // returns just the comment body without the keyword
};
var comments = htmlcomments.load('div>
var comments = htmlcomments.loadFile('file.html', options);
htmlcomments.loadURL('http://www.example.com/index.html', options, function(err, comments) {});
`
` html`
Load an html file at the given path. Returns all comments from that html file.
loadURL(url, options, cb)Load an html page at the given url. Returns all comments from that html page.
load(src, options)`Load html source string. Returns all comments.