{"name":"@starptech/webparser","version":"0.2.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","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":"a259549392df15325c7871ffb814a0724918ad3f","_resolved":"","_integrity":"","_from":"file:starptech-webparser-0.2.0.tgz","_id":"@starptech/webparser@0.2.0","_npmVersion":"6.4.1","_nodeVersion":"10.10.0","_npmUser":{"name":"starptech","email":"deusdustin@gmail.com"},"dist":{"integrity":"sha512-ZXRdQhRjNn11C+tR46vT+0DSinpBEk0jvMHNOEiBxNqp+L5SyxUltJNTJYGlsqcy6P5tRiSePoq2eP5KmlWn2g==","shasum":"074ef4c1422816d5f30c732b52795a0794d3ba4d","tarball":"http://registry-npm.ywwl.com/@starptech/webparser/download/@starptech/webparser-0.2.0.tgz","fileCount":48,"unpackedSize":174333,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbuPRPCRA9TVsSAnZWagAACtUP/0f/HOhz+uhS425duuhs\nNOsb14i75GgBbzEa/QSeu79fFpZL9iwVx/q72p3hKwgjyb9HGVy94ahzSI6t\nxTqClYWkOiBOKb39EVjMqmV1DakvzlPzv4ovEd1SgQI6coIgmpiYFmezwLtH\n0EEwsL+jgsat6w+HQopTrGuRCCutbM4aaxCaaJYgkR9ODVIS0VUP7pZ2sWGt\nnNY6UcCGVHyEuGmdDJxgHW3+k8wGMCmnX4jHWmBrlIb/EXMC6SZLNiOKqVE8\nAxcyb/3HK/4wWWfEYijNMGYamhPhMQ4n+XigmqtUOLTN+SwUk6bgOVubpXmm\nfJXojxjtT2NqJI1N/n3C4kjpaioqZKAswZo/HL1VVEL8cB/SLoJwM9S9Dgis\n3uEdNXEjBWLg5m/IbOqoxdIOex3Yb86gsuyDk6+yKsQ6HGEQT4ORILP4Rk5A\nFN64vxcEG7SOjofW3TFpvuOQvJw01Et+kRvCsR3B23Jw4iaqgFK41TdUhxwU\nFatG43obowMWzZdIQfml7Xqklw9//zB4zwNYhf9oda9Hz/NlL6VYTMKkJTYZ\ntSEa5OM9t14Zo8aQXqjSE2AsrDXa7s1fvhHOgVTo4W61UB9kSu04zD2756hN\nWTetlgQRmCK1vGM0eE7DL5NnVxFAGOqlqWKKUzwhiPaq8Ut5BqaAWWWE7ynP\n3Fdv\r\n=x7Jm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICHUBY7C6qE2eCgTrWCLl1A+dbLDumlXL4aauzex74YzAiAtiEfrP4+Pa3W8bZa2ZkVlw4j9SqqDdK6fQ1ISW+oYAw=="}],"size":40116,"noattachment":false,"key":"/@starptech/webparser/-/@starptech/webparser-0.2.0.tgz"},"maintainers":[{"name":"starptech","email":"deusdustin@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webparser_0.2.0_1538847822979_0.8905000200737365"},"_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":1538847823124,"_cnpm_publish_time":1538847823124,"dist-tags":{"latest":"0.10.0"}}