3.0.2 • Published 6 years ago

parse7 v3.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

parse7

NPM version NPM downloads CircleCI codecov donate

Install

npm i parse7 -S
# or yarn add parse7

Usage

import parse7 from 'parse7'
// OR const parse7 = require('parse7')

parse7(html, handlers)

API

parse7(html, handlers)

html

  • Type: string
  • Required: true

handlers

  • Type: { [hook: string]: function }
  • Required: true

    Currently there are 4 hooks:

    • tagStart(name: string, attrs: Array<{ name: string, value: string}>)
    • tagEnd(name: string)
    • comments(comment: string)
    • chars(char: string)

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

Author

parse7 © ulivz, Released under the MIT License. Authored and maintained by ulivz with help from contributors (list).

github.com/ulivz · GitHub @ulivz