{"name":"@starptech/webparser","version":"0.5.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":"316bf4726c2a35ca3fcf5172e46a05936908f173","_resolved":"","_integrity":"","_from":"file:starptech-webparser-0.5.0.tgz","_id":"@starptech/webparser@0.5.0","_npmVersion":"6.4.1","_nodeVersion":"11.0.0","_npmUser":{"name":"starptech","email":"deusdustin@gmail.com"},"dist":{"integrity":"sha512-6ZyFMO/qRDsqvr1KAHvzHUsUDKrElwP4++cQyFn7nNUV+eW0sjFKzq9TokVIje8q03oKjGz/+5CITRyYvaY/1g==","shasum":"b50c35dab9934b5728246d7fec7e684208d4e7c9","tarball":"http://registry-npm.ywwl.com/@starptech/webparser/download/@starptech/webparser-0.5.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\nwsFcBAEBCAAQBQJb1eUHCRA9TVsSAnZWagAAXhoP/jV5gPM4/l/bZ9KtEk9F\n5Y6NfH2sYls6z4binYaMigrXhUkbJHzUyML1BkK7G9MEZaAQh5W0RwmPwdBs\ncKQ8UV48eHjKfcm3A5ij2tN3cZ9ZVOQjLzJ7gL0ejGsiecjkbCHS+IXpY799\ne9GFIiL7YDCTmhDQAYbAZ1ZiYiNAZE1k2OJI+tVd7GpE+4x/+YbQ9id6uqzS\nQmBrFij/u7yA2Bo17Du65lCBY9p0Eq2fPm++XQrNKA455S8qv6124EIS+Mr5\njwLuenfqDtjgeu0+vnrvBohuXojhoz9zdsuECZ2Ydwn+NI/e5x9m/8Es4/df\nGVC5VyJ9sA7/g2pEZLcD18SH5esTTwSAozJpRsUb19TjKvzZOpQo0hx2G/t7\n80nxSnfWP+4gyzYHOzOKmtyhRIBo9jJy2CBbEqWAvuEEbC6uEc6j1v7gQRss\nx9NcVysp+GC9i0Xpk2Lg7KY8ZeAOTwvC5Pq6odwm0mrhlsTNGYD4KALww/Sk\ntBtEGgnX7Ib7FxVPJs0bgL4aQ4S9euR7EAwyDXF3zKc4rrQR46QtEwRnn4Kq\nQ794PDOdg6HFsECP6MsLaMkQxvU9xI/BS0nzOb1plo6Mh0fgxDvQXm/nZVkb\nlYKwyyYe5ePW7D9HChDfXsxhq4/1IYCsgqzuHBotc2h37m9dejcT+yJB0F5p\nenA4\r\n=E/UL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID09HCG7/fqGMIS9Ey3XV2TPrqWG38QrQje5HeR6Oz7wAiEAyAQyLv7sgDO3y1QXqQEkF0MiM+3YNUAYbKBW/gl90PQ="}],"size":40485,"noattachment":false,"key":"/@starptech/webparser/-/@starptech/webparser-0.5.0.tgz"},"maintainers":[{"name":"starptech","email":"deusdustin@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webparser_0.5.0_1540744454974_0.6645349304825758"},"_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":1540744455090,"_cnpm_publish_time":1540744455090,"dist-tags":{"latest":"0.10.0"}}