{"name":"@starptech/webparser","version":"0.1.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 --verbose --detectOpenHandles","test-coverage":"npm run test -- --coverage","tslint":"tslint -c tslint.json -p tsconfig.json","postinstall":"npm run build-ts"},"keywords":[],"author":{"name":"Dustin Deus","email":"deusdustin@gmail.com","url":"http://www.starptech.de"},"license":"ISC","devDependencies":{"jest":"^23.6.0","ts-jest":"^23.10.1","ts-node":"^7.0.1","tslint":"^5.11.0","tslint-eslint-rules":"^5.4.0","typescript":"^3.0.3","vrsource-tslint-rules":"^5.8.2"},"publishConfig":{"access":"public"},"gitHead":"9017580e4e52cbc747fb63d19ed420d14924f85a","_resolved":"","_integrity":"","_from":"file:starptech-webparser-0.1.0.tgz","_id":"@starptech/webparser@0.1.0","_npmVersion":"6.4.1","_nodeVersion":"10.10.0","_npmUser":{"name":"starptech","email":"deusdustin@gmail.com"},"dist":{"integrity":"sha512-yT8xJTBlF91MtvU0EE7lSFEV5t67p9H55JG7g8PMf429JvAvnNrzUxwkxjHcSqoH3O23EK5f4aCc2BFrHLDY/A==","shasum":"0de129922ffa3e94ae3277bcf544fbd1be73c80c","tarball":"http://registry-npm.ywwl.com/@starptech/webparser/download/@starptech/webparser-0.1.0.tgz","fileCount":89,"unpackedSize":762397,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbr050CRA9TVsSAnZWagAANiUP/jb8iY9gYRQnJvGMNx8U\npADg1SqbX9uRL6McNWIxIFSZoxcTPen5DpXNT9SWyVxW6CzaFHEDUu368MxM\nUyk8vfuWvwnotLZ9ZZv+PAJvd/DYVolhll4ThbvkHmx8CpKbj1qlV9K22ZJv\nNAuvI21a9RipnohFFw0kiw6/XtoMcoyCI0+DvSx5cJqJQrPHbKw7zYClYHwh\nSvIOMhXF+efi6wT7/v7P6f9sWrt4AA3iBRu1nStuKJx6rjUrulBlk50hsVHh\n+qniU+XhMUri1cgfALreHfZbxBNTg9FGIlyLaHnEPz97ST/kLTNWY5gnjsp5\nIf2EhgyZScJ1dAlW0eozTARXx1Xo1uT33gGnRNRPgpZ7iuUQmZWK5QQCoJ35\nhA2iry8+yEg/NLZiEeecl1HqMKRdHX4Dcpemv/kXCOflTKa/kKNqMU2Nhk/M\nhIbB13BK7l0EbJkhKB9CBEhXw+bqLDF1zwZo3NeRvNnpWR9/Tm/wyUICYqV9\n4Eh5xwL4WbrfotCelqVPBgDcNCCE+yftqA83d8A+lMzu1eL7QvFIevYUjvJ3\nCJ4TRhcVqaZHtPHI/AXeKBIAfWbjtOeObTFs78BC75zHnJ5Ne6KYFrkRLdTs\nBy9zz7OjOP9pVr02r03jSVYV4VN3bkFx1uaL+altszLq8VADy3m+O/n4VO1m\ntRbQ\r\n=oLjA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDHtchn3URxqOyxewTTmXg3KeSoZcGy60I3G3UPdEUWzQIgNmhe/jfKAE+OM9SbE6sDdPW9pKxOXhyaorGOvspVYy0="}],"size":135573,"noattachment":false,"key":"/@starptech/webparser/-/@starptech/webparser-0.1.0.tgz"},"maintainers":[{"name":"starptech","email":"deusdustin@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webparser_0.1.0_1538215539474_0.4467855398976235"},"_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":1538215539583,"_cnpm_publish_time":1538215539583,"dist-tags":{"latest":"0.10.0"}}