{"name":"@starptech/webparser","version":"0.8.17","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":"yarn run test -- --coverage","tslint":"tslint -c tslint.json -p tsconfig.json","prepublish":"yarn 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":"f51b884554e7d3f7ae31fc3245f89e606334109a","_id":"@starptech/webparser@0.8.17","_nodeVersion":"8.10.0","_npmVersion":"lerna/3.13.0/node@v8.10.0+x64 (linux)","_npmUser":{"name":"starptech","email":"deusdustin@gmail.com"},"dist":{"integrity":"sha512-St95Jolws0W5NVB+OS0w84Tgu9BHlb+JPltSWD4lDwVIwv7x1lVHdat52AwHQdHPzUY2xGOz1g7Gdb5jSTTk3A==","shasum":"ac02e4d7f97a2922ff7d8754c1a357d25997fae5","tarball":"http://registry-npm.ywwl.com/@starptech/webparser/download/@starptech/webparser-0.8.17.tgz","fileCount":48,"unpackedSize":174765,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcqjbeCRA9TVsSAnZWagAAe2kQAI0djFTaH78/RFT4IKBc\nWZa0+90tquDGJAVYAtw0sv36QOZtm0FuPPhvpeOXKT+MC/s84SCjnXO8uoTj\n6q5Ads1D/nWctJl1o1i88HnyVoOtsGTcQ1tqBBff7v6kOxjydGmIS/P54dw4\nfIeKHXjuVh0sXWL2l7Nl7XBXSHcecuU26q5EAgqeHp8zBLqQustZUvecUGJQ\n24xJaRIS22QUmkKOt7VytEj5Mu27rfQx1TCIjcQ7WpRW/BvX3HpV4x5JDR/K\ns8ZhMXIvbqOJcXRY8SUq4m6MR/avY3+JSF8TsRabC4kmnZBHzAlFTxDlbX+C\nNd0KZkAi3g237jWoVZlooYhuNLbTzSpLDEXlNnWdDfbhIUiYe5/CenuFpzfe\nQdtOFDLHLMGu5/KnLSiv1osp2hctLXCwA1q096IUU4iiz/PRIM7/N3Z6f+Vi\nZiY/IVOqzTQ5W79JND3ImqfvEoIv0i8TFAJXL+RwaiJA4eDWvktpE1eCxkDE\ngtg0Xx/1BOJtLu3lZlIt4qlIobZ4NNDKiywqzDehBmA6O0KNRNRLSKldf4/I\nKNzXMJ8YTLF8Atm/TyuOTK9F69yduToRtC1JO5ABJPR6UL8G3Z4VXE879kdN\nJWNvi/F3+xWcsFsHg1CyTE8rAW2YviUgSOnl+CJbaVEHCMvt8u/3WD/1FEss\nXcjp\r\n=5EmE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF5s8K/FUaLKcmOkHng0b7TWkxHfwkWsUuqGvIQw8OJYAiEAmlO7g1L0/5gPCGnbGYhPYDqjjpzm+BsMi5EuKrqXPAc="}],"size":40046,"noattachment":false,"key":"/@starptech/webparser/-/@starptech/webparser-0.8.17.tgz"},"maintainers":[{"name":"starptech","email":"deusdustin@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webparser_0.8.17_1554659037836_0.852119122692901"},"_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":1554659037927,"_cnpm_publish_time":1554659037927,"dist-tags":{"latest":"0.10.0"}}