{"name":"@starptech/webparser","version":"0.9.0","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":"^24.7.1","ts-jest":"^24.0.2","ts-node":"^8.0.3","tslint":"^5.15.0","tslint-eslint-rules":"^5.4.0","typescript":"^3.4.2","vrsource-tslint-rules":"^6.0.0"},"publishConfig":{"access":"public"},"gitHead":"c7c203521b9e87f18690e30ca5a9b413de918c5e","_id":"@starptech/webparser@0.9.0","_nodeVersion":"11.14.0","_npmVersion":"lerna/3.13.0/node@v11.14.0+x64 (linux)","_npmUser":{"name":"starptech","email":"deusdustin@gmail.com"},"dist":{"integrity":"sha512-QEC1yjpsOtj3leNCWZGirAyVCN7WJDH+rUhfMVGQuLEfoJNKK66t/UWAOrXeGxR2jdU5IffAGnqZIHbFMX6SNw==","shasum":"7b2a1e554001381bc3b0b8eb7d21fc6a020c6766","tarball":"http://registry-npm.ywwl.com/@starptech/webparser/download/@starptech/webparser-0.9.0.tgz","fileCount":48,"unpackedSize":174763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcxXz9CRA9TVsSAnZWagAAhi8P/3Jl7Srlymvif1Z/5Cg6\nBUgEJKFD9B4dASd7eAmxuY1e47eF9KGFKlORAB6nkyRHiIwS84D2jIpx5hJU\ng8sDhn/c2icHX4SXg4lBxP0+ud6/770YeNeRyKDVBdZ8sEj0tMrB2mXEheQZ\nzND8wTgvGwbIsTc9kO/dQ7hLRggHQBh8216a9fDaWW6+svtGN1W6ZDYdLfAS\nsPArOvf82istI4aVkpN8S6Qf19ksgqsEth0q55nx26Ibbq3h0utUvX9qQTLY\n74vk+H0Zwt7zqxn6Jutg1Q+YEZPpWgcA6iYi9KgUy96SmRCh4y7SCrsWd9k5\nftjYph2+I/7YzvKGbmUsLMqLwnZvi+cl235H+Yehd4RoQ16cF+blZMUMs3a2\no51OoBOnufg4pJpYuMu9KA8VnYlFwUG2VXeWJBUbBMkJ6ulcnCeJJV6chWO5\nyVo7sFj4HkbUCnV53i30HfoJ1suO92vpzRaqZ5pitFKWF0it0tx9hYQSSSYs\n4DADZ22cm8t+zudXfqT7hOIrSo2TREkz+q8WR08QR7gK+5SQtVoS1a2HYrwK\nbEXXmPzgHCzicM+CRk4EGvf+g/w5ms8NOHR9uiOClAdiRWpnHkqKSwgvgcV0\n5AGWgXnICF8efj01XpSSne74chyksTbmd/IJbEsKnoLl8NO3whoVZMru5Gn8\nQCGZ\r\n=hOUa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCoxlCHCDgkLHF90ZebfuAnTnR9eTaBkC1OvJkgecnd6QIhAObiH6Z2jKdSRTqJOVwQ36k0uQ0kp3j0W3Ouvohu/H3E"}],"size":40045,"noattachment":false,"key":"/@starptech/webparser/-/@starptech/webparser-0.9.0.tgz"},"maintainers":[{"name":"starptech","email":"deusdustin@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webparser_0.9.0_1556446460800_0.32928601461780915"},"_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":1556446460991,"_cnpm_publish_time":1556446460991,"dist-tags":{"latest":"0.10.0"}}