{"name":"@starptech/webparser","version":"0.4.2","description":"Optimized html parser for HTML5 Web Components.","main":"./dist/public_api.js","scripts":{"build-ts":"tsc","watch-ts":"tsc -w","test":"jest --forceExit --detectOpenHandles","test-coverage":"npm run test -- --coverage","tslint":"tslint -c tslint.json -p tsconfig.json","prepublish":"npm run build-ts"},"keywords":["formatter","webparser","parser","htmlparser","html5"],"author":{"name":"Dustin Deus","email":"deusdustin@gmail.com","url":"http://www.starptech.de"},"license":"MIT","devDependencies":{"jest":"^23.6.0","ts-jest":"^23.10.4","ts-node":"^7.0.1","tslint":"^5.11.0","tslint-eslint-rules":"^5.4.0","typescript":"^3.1.1","vrsource-tslint-rules":"^5.8.2"},"publishConfig":{"access":"public"},"gitHead":"e0c41744b2edd0c78df7198e4f461cccf37a83ae","_resolved":"","_integrity":"","_from":"file:starptech-webparser-0.4.2.tgz","_id":"@starptech/webparser@0.4.2","_npmVersion":"6.4.1","_nodeVersion":"11.0.0","_npmUser":{"name":"starptech","email":"deusdustin@gmail.com"},"dist":{"integrity":"sha512-wPnJZ1y420gl3YFnW4jdmOcpycaIq2c0S8Gfq4OIqXs5A7R2CYjd0NJ3r61LnOKzUYOEKkENOzFFvIOiqRkEZw==","shasum":"c0581ec8295dd3c4a4d4539e8e30660c1cd4d4e1","tarball":"http://registry-npm.ywwl.com/@starptech/webparser/download/@starptech/webparser-0.4.2.tgz","fileCount":48,"unpackedSize":177871,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb1DsGCRA9TVsSAnZWagAAZqUP/2Dpx/RKT5LETUMib+m0\n18Cka7keLemrVqYCcrv8Lziz5b5f+xWYU2Tv6bObMRycOmnXCwNHO3BX7tmp\nd80pbStCFXip2ZAzOzlW9TDB+ADMOyUrEXgxpW+s6znPMe68YZG9BOiqYswT\nSBWHeNjQZNaHR4wv/R1+Er5gQyCM9Jr8XW2iN5mq16LjH/9kGjrQFaYaGY8I\n3ioty5YyG4dlTyVcOkqr3eNFrk6E6M5Xt7degjZLfXsMhBu6mBMF4+FznzFp\nmsNLqLIVnYKhQGs0zAUgrJ1lFN4znNTWtkb1pJBPK0Bf+JczOXZk7NUllHfw\nr7ixF058LL2/0S3frOXzIUel1YUbqgeAuSIbqqcmFxV9xnD09Xug4u4QJQoX\nWwlYZ2Yd1NTaiaYZ8NOElbQtxozTWXMZrYs5sH9abMiwCzGuW1t52vTdEZiW\no59ApSYCwY7NW7ZzZb1e/rUc3deQhOYg1P0XAOkebSOxGdWgQZVopctZQaVI\n2/kdiWHbBq3g8dBi6WYpfWKcvOzdqhfdIkfOTKQtODl6B5ig34w3yGVVedO5\nh7h09vXPZJh7RMsmOoJt62zIzWROjPtzFKsAzidqAEdyNsfZWgCaCxaCCp9x\naLRKZkBEP+zFnQlaqpSQ96uXJN71pChPaFVQie5j+M80YUQU00ZXSlq3EADD\nAS3X\r\n=FUfW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC0JCxF2lrI+PUFg50xD8iKNMgws7D2PCsXKAwR2JTHsAiEA346D0q9+6I9BhwwLx24cF/1F9Kq7mpgDZd6Y1s0dHHg="}],"size":40484,"noattachment":false,"key":"/@starptech/webparser/-/@starptech/webparser-0.4.2.tgz"},"maintainers":[{"name":"starptech","email":"deusdustin@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webparser_0.4.2_1540635397751_0.5500392608748588"},"_hasShrinkwrap":false,"readme":"# @starptech/webparser\n\nOptimized html parser for HTML5 Web Components.\nThe parser supports features which are very useful if you want to implement a HTML formatter or anything else where a less strict parser is needed to keep all informations in the ast.\n\n## Installation\n\n```\nnpm install --save @starptech/webparser\n```\n\n## Usage\n\nThis example shows how we parse HTML\n\n```js\nconst parser = new HtmlParser(options)\nconst result = parser.parse('<div></div>')\n```\n\n## Representation\n\nThere are four different types of nodes\n\n- Doctype\n\n```js\n{\n  value: '<!doctype html>',\n  sourceSpan: null\n}\n```\n\n- Element\n\n```js\n{\n  name: 'div',\n  attrs: [],\n  children: [],\n  implicitNs: false,\n  sourceSpan: null,\n  startSourceSpan: null,\n  endSourceSpan\n}\n```\n\nVoid or self-closing elements can be checked when the `startSourceSpan` is equals the `endSourceSpan`.\n\n- Attribute\n\n```js\n{\n  name: 'div',\n  value: 'foo',\n  children: [],\n  implicitNs: false,\n  sourceSpan:null,\n  valueSpan: null\n}\n```\n\n- Comment\n\n```js\n{\n  value: 'foo comment',\n  sourceSpan: null\n}\n```\n\n## API\n\n##### `HtmlParser.parse(doc: string): ParseTreeResult`\n\nParse a document and returns a `ParseTreeResult` result.\n\n###### `options.decodeEntities` (enabled by default)\n\nDecode html entities in text and attributes according to HTML5 specification.\n\n###### `options.ignoreFirstLf` (enabled by default)\n\nIgnore first line feed of `pre`, `textarea` and `listing` tags according to HTML5 specification.\n\n###### `options.selfClosingCustomElements` (disabled by default)\n\nAllow custom self-closing elements.\n\n###### `options.selfClosingElements` (disabled by default)\n\nAllow custom and known self closing HTML elements.\n\n###### `options.insertRequiredParents` (disabled by default)\n\nInsert the required parent element according to the HTML5 specification.\n\n## Credits\n\nThe parser is a modificated version of [Angular 6](https://github.com/angular/angular) template parser.\n","publish_time":1540635397917,"_cnpm_publish_time":1540635397917,"dist-tags":{"latest":"0.10.0"}}