{"name":"@starptech/webparser","version":"0.1.7","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","prepublish":"npm run build-ts"},"keywords":[],"author":{"name":"Dustin Deus","email":"deusdustin@gmail.com","url":"http://www.starptech.de"},"license":"MIT","devDependencies":{"jest":"^23.6.0","ts-jest":"^23.10.3","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":"29ffccd70e71f45f423929d7e8ea9b95125169e0","_resolved":"","_integrity":"","_from":"file:starptech-webparser-0.1.7.tgz","_id":"@starptech/webparser@0.1.7","_npmVersion":"6.4.1","_nodeVersion":"10.10.0","_npmUser":{"name":"starptech","email":"deusdustin@gmail.com"},"dist":{"integrity":"sha512-hXyhypSH/XYDNKgiAg2sCA8GCiZEsFMfOHCAE3dyNl4O9kiyXRJy9Gu4Rd22BYKEgBX/phOAprEtOH4AbnsyjA==","shasum":"30b21113320ffa57327a9d9a0a5350642dbe2eca","tarball":"http://registry-npm.ywwl.com/@starptech/webparser/download/@starptech/webparser-0.1.7.tgz","fileCount":67,"unpackedSize":272473,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbsoI1CRA9TVsSAnZWagAAtWgP/jKR+//H39PeiPG1pftO\nL0hwLCDeyudYjo10CNK9uBDVfXKicrug9xLrjbIBfRVyuSZfpbtRAkwBY4z2\nrV422900fZfrCf68OM3dLPiBzk0CTsl90hKwSLKAJ7ek6vpHfWCshsCREVPF\nW0F6vvxzO/MZR7KLGma8n7aIAZ5DepSaPI0jBpWK1zAfS1j28nAtyPxSGn7Q\neIhV8EcRLMGToFxotYsicjpc6uhYyntLxoxDvEkxCWH98FRpaUoSgarTTdxf\nSgVGXSjer/PrKSy1bbdkLEtexW/jRKgbIT0aNPirAYr60XF76Jc/FvIq5mul\ns3RcMeS5LNHpZfvp6lIkqTbS0OlUicVGdgjZYNMoLQVGSKOjMI3S+B+3AukC\nsYyw1fyGCHPhZw4S8T4eoPPyIeHX/pEXpX1mYciR/Q4MdmgIWH23omJKAylo\nFZT6Xs1yPY/Uhlx2iWE0wM9KtiGeAwXT03ZCCTqgSVKsXKOiVLosFH3o1+tj\n0v5vYjACZQDVPQkzCrz5A5D3a8W2TOMjICwifPHz1vp5rKL6zi8XcUJMhE6h\nPyh61LwAF+Q68ZJIBUU/oQKBVOO4mQOabveXPcJbi7EG8euGYmPWJycc8xG7\nS1fXDDSsm13O9rbmkrvXH8IdLYOgTWJ2+SDe6rC4kN3SnFAM+hz3BUap31SI\nI2+s\r\n=Mat1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDJ7sFIzCx9z6i7qVf78L29nRTZBx5TH5sSX8ef5+2qcgIgYBluLOM2+EgJJZ5qKxn4BGxIrHUSvCr/phoIAB15Qlo="}],"size":62854,"noattachment":false,"key":"/@starptech/webparser/-/@starptech/webparser-0.1.7.tgz"},"maintainers":[{"name":"starptech","email":"deusdustin@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webparser_0.1.7_1538425396352_0.3163201187357907"},"_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":1538425396505,"_cnpm_publish_time":1538425396505,"dist-tags":{"latest":"0.10.0"}}