{"name":"@starptech/webparser","version":"0.6.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":"npm run test -- --coverage","tslint":"tslint -c tslint.json -p tsconfig.json","prepublish":"npm 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":"cac4b4a67029454e823e3a2ac9f0f88be8c72ba8","_resolved":"","_integrity":"","_from":"file:starptech-webparser-0.6.0.tgz","_id":"@starptech/webparser@0.6.0","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"starptech","email":"deusdustin@gmail.com"},"dist":{"integrity":"sha512-9K8tnI8DkoWdkkXANzx9loE6Oeg3Lp2LsUc8alHPgke19z8G9VwnnwwYm9d72YdGD1UgBYqIEBmGfygdPldABQ==","shasum":"326dc6c14808cd0c4bb06714e4227ec93eb3b5d7","tarball":"http://registry-npm.ywwl.com/@starptech/webparser/download/@starptech/webparser-0.6.0.tgz","fileCount":48,"unpackedSize":177871,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb5LT9CRA9TVsSAnZWagAAX0EP/AusQrp0ZmkJwwg367zn\nYXfwZ7M8Y90aJpmv3YPsXoXzYanpi09jFShKW5nT8TjxIVAE5PY6kqe6Is7u\nZUeaIn4j1st6J3BNAYYUEVMnfPh8Tz0P128rD+Hpgo/6LUHMDfPSeLMkhmDg\n5tlXnW1jNUS5RkKzGs7fhEp3BCpvBGblXL6SfHdwpUC3iRRjG+P/ru7QbcbY\nqlocr/BOVfAaI2syhsygMEwMfcGyWkfimkomoIDy2yjxqMR8STcPO7lZc0Gr\n53daOkCwsMTej4mjlnnEE57btrzRtCxH9ana7TPnm512UZ5rgQtqBfAo7jfA\nxwYb3m6AE9DaZ2Hm96x1nZJGPDyiI+lKhg03K8dtTnGDjx+mUu/ciISzJ7qZ\nL4ShUugAIp8cpwVWCNusncln1xJo5eQREAFZaUExpDbgPPzI+0flw6Ap76AD\n+cDEu0U/51HbMoljG5rS9CXeLStWEJH/y8j8nDLia8jgw1Q0ImVZoOX1nS0H\nl38BX1p3Hirsy1f6TdmMPJ/j0mbeue/b35BA0gz6Kojsnv2zu9HUrpyUpUSH\nB5rb8Nmj/nEqt3hHrUbIiUII/l51HvtUOTkEPC+1N7bas4TTX8Js9CFt9+RI\najUpEQlJOBlUvl0RUgcrxZW7MvMpBHOKXzBRyZo1JLqpMMoJagq9BsHSS3pN\n8zoN\r\n=Gcc3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDHNhrInHuiMwDFR150U1KdvLxFf6BjRcHdNWT1fLsEHwIhALRzGk7VnsdleNrgJlKCGfA+xx6B64ypR0Wy5JdLJBbD"}],"size":40483,"noattachment":false,"key":"/@starptech/webparser/-/@starptech/webparser-0.6.0.tgz"},"maintainers":[{"name":"starptech","email":"deusdustin@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webparser_0.6.0_1541715197336_0.10278259286697211"},"_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":1541715197476,"_cnpm_publish_time":1541715197476,"dist-tags":{"latest":"0.10.0"}}