{"name":"@starptech/webparser","version":"0.10.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.8.0","ts-jest":"^24.0.2","ts-node":"^8.3.0","tslint":"^5.17.0","tslint-eslint-rules":"^5.4.0","typescript":"^3.5.2","vrsource-tslint-rules":"^6.0.0"},"publishConfig":{"access":"public"},"gitHead":"c417941cf747a0c94abd2dd17eb468395195e752","_id":"@starptech/webparser@0.10.0","_nodeVersion":"12.4.0","_npmVersion":"lerna/3.13.0/node@v12.4.0+x64 (linux)","_npmUser":{"name":"starptech","email":"deusdustin@gmail.com"},"dist":{"integrity":"sha512-vA/p1LTVfuK8dP+EhBglMS7ll3dZahBjnvjwUiJ8NNUCqH5pSAj3tcRtOG3k7k1Wx1hWHJpGgZVj0VNQIo99bA==","shasum":"cb1269865086e2a7178492fa9add44d468fbd7d9","tarball":"http://registry-npm.ywwl.com/@starptech/webparser/download/@starptech/webparser-0.10.0.tgz","fileCount":48,"unpackedSize":174764,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdDVMACRA9TVsSAnZWagAA+IMP/RlsnMSHN5qJGkWaprLT\n7tQ4fflcSVQTi6bdyaG0rHVaUCqjcfkQ3zdE9aOF5TwZmiB7VnNiEVxA8E2V\nDa1GWVPrVs3E/k4Zb9pr6O7jhl4ehW6s+nSSbGwiOdZEy8nnltbeJm72ZTIm\nP66X7ctbA2CrG6Z9drCD9TeOdU9cC3kWCXAhMFLLQRncAA/QtYgcqGDRLsdS\n7tsjm5IWPP4XQp37JiuLTfvKDUlti/ZP5FPkYz6YpruXDHVo3Xjfm3T95DY5\nPJw6V4/QtjyZa1bvGG4dRlIfbH9S6hghtZWyCdJACuj08+kDbQvz10NGH3F0\nctDn8+IlzVTBixnNn6y1W9n7qd120+SFZTbzDhNESx5e/b8wN+05bYlp4Jcz\n+J10IcXyBnKfzTMol42Gz0Ie0+jM1DnJUHw+0pPtoq/azZ1KIHOLmd/uliTH\nr0wQvEnoR6ZJyMCVgd0cgxzxFpCooZetNU0pvzgH9D7zH9Tn7aVxxyhF7UF9\n5rpf3Z//pGWW5LROuVpT7+1U+CZmlDj8aB9cKMgmcUOkc01h5YB5iJlL3UIP\nEc78P83H8J5vK//RjwXxCceHYjOwnLpZyFA8nUd/LJ/H2cmSZijKfN2SByE5\nG6HmTcwzHGGGQIWONdczYN0Ln7IoUAwsCKqWqhQo05P6Jk1+6AimbEiBOl72\nBm7h\r\n=6KSn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEh3u7BgiGhrQ66qwtUiEnnvyLXktzwGxte154FNlFfoAiEArHBVlKoZjWuBcK7AmccRGuA1pSuD67DyV6ULqcJIQbs="}],"size":40049,"noattachment":false,"key":"/@starptech/webparser/-/@starptech/webparser-0.10.0.tgz"},"maintainers":[{"name":"starptech","email":"deusdustin@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webparser_0.10.0_1561154303512_0.4507492781272222"},"_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":1561154303745,"_cnpm_publish_time":1561154303745,"dist-tags":{"latest":"0.10.0"}}