0.5.0 • Published 7 years ago

html-comments v0.5.0

Weekly downloads
29
License
-
Repository
github
Last release
7 years ago

html-comments

Simple nodejs module that collects all comments from input HTML. Optionally filter out everything that starts with a given keyword.

Example

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></div>', options);

var comments = htmlcomments.loadFile('file.html', options);

htmlcomments.loadURL('http://www.example.com/index.html', options, function(err, comments) {});
<div>
  <!-- yep
  ima be collected
  -->

  <!-- nope
  aint gonna be collected
  -->

  <!--
  me either
  -->
</div>

API

loadFile(path, options)

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.

0.5.0

7 years ago

0.4.0

8 years ago

0.3.0

8 years ago

0.2.0

8 years ago

0.1.0

9 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago