# html-comments

> Simple nodejs module that collects all comments from input html. Optionally filter out everything that begins with a given keyword.

Latest version **0.5.0** (published 2017-04-06) · 0 weekly downloads

## Install

```sh
npm install html-comments
pnpm add html-comments
yarn add html-comments
bun add html-comments
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.5.0 |
| Published | 2017-04-06 |
| First published | 2013-11-19 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.8.0 |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Arjen Scherff-de Water |
| Maintainers | aratramba |

## Links

- npm: https://www.npmjs.com/package/html-comments
- Repository: https://github.com/eightmedia/html-comments
- Homepage: https://github.com/eightmedia/html-comments#readme
- Issues: https://github.com/eightmedia/html-comments/issues
- npm.io page: https://npm.io/package/html-comments

## Dependencies (1)

- [cheerio](https://npm.io/package/cheerio.md) ^0.22.0

## Recent versions

- 0.5.0 (latest) — 2017-04-06
- 0.4.0 — 2016-10-26
- 0.3.0 — 2016-10-25
- 0.2.0 — 2016-10-19
- 0.1.0 — 2015-05-06
- 0.0.3 — 2013-11-19
- 0.0.2 — 2013-11-19
- 0.0.1 — 2013-11-19

## README

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

# Example
```js
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) {});
```

```html
<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.

---
_Source: https://npm.io/package/html-comments · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
