https://github.com/reshape/parser
a simple and fairly forgiving html parser for reshape
https://github.com/reshape/parser
Last synced: 9 months ago
JSON representation
a simple and fairly forgiving html parser for reshape
- Host: GitHub
- URL: https://github.com/reshape/parser
- Owner: reshape
- License: other
- Created: 2016-08-09T16:32:19.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2019-02-05T12:32:35.000Z (over 7 years ago)
- Last Synced: 2025-03-24T05:26:36.632Z (about 1 year ago)
- Language: JavaScript
- Size: 302 KB
- Stars: 8
- Watchers: 2
- Forks: 4
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Contributing: contributing.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Reshape Parser
[](https://npmjs.com/package/reshape-parser)
[](https://travis-ci.org/reshape/parser?branch=master)
[](https://david-dm.org/reshape/parser)
[](https://coveralls.io/r/reshape/parser?branch=master)
An HTML parser for [reshape](https://github.com/reshape/reshape) based on [parse5](https://github.com/inikulin/parse5), featuring source location info and more robust node types.
> **Note:** This project is in early development, and versioning is a little different. [Read this](http://markup.im/#q4_cRZ1Q) for more details.
### Installation
`npm install reshape-parser -S`
> **Note:** This project is compatible with node v6+ only
### Usage
```js
const parser = require('reshape-parser')
const html = '
hello world
'
parser(html) // returns a reshape AST
```
#### Options
No options are required, all are optional.
| Name | Description | Default |
| ---- | ----------- | ------- |
| **filename** | Attach a filename to the `location` info in each node. | |
### The Reshape AST
See the [Reshape AST documentation](https://github.com/reshape/reshape#reshape-ast) for more information on the format.
### License & Contributing
- Details on the license [can be found here](LICENSE.md)
- Details on running tests and contributing [can be found here](contributing.md)