pax_global_header 0000666 0000000 0000000 00000000064 13706575615 0014531 g ustar 00root root 0000000 0000000 52 comment=37227a3429584903cbd1799dade995266fc2dbe6 parse5-6.0.1/ 0000775 0000000 0000000 00000000000 13706575615 0012734 5 ustar 00root root 0000000 0000000 parse5-6.0.1/.editorconfig 0000664 0000000 0000000 00000000363 13706575615 0015413 0 ustar 00root root 0000000 0000000 # This file is for unifying the coding style for different editors and IDEs # editorconfig.org root = true [*] end_of_line = lf charset = utf-8 insert_final_newline = true trim_trailing_whitespace = true indent_style = space indent_size = 4 parse5-6.0.1/.eslintignore 0000664 0000000 0000000 00000000217 13706575615 0015437 0 ustar 00root root 0000000 0000000 packages/parse5/lib/tokenizer/named-entity-data.js test/benchmark/node_modules/**/*.js test/memory_benchmark/node_modules/**/*.js node_modules parse5-6.0.1/.eslintrc.js 0000664 0000000 0000000 00000000722 13706575615 0015174 0 ustar 00root root 0000000 0000000 module.exports = { env: { es6: true, node: true }, extends: ['eslint:recommended', 'prettier'], plugins: ['prettier'], rules: { 'prettier/prettier': 'error', 'no-console': 'error', curly: ['error', 'all'], 'prefer-arrow-callback': 'error', 'one-var': ['error', 'never'], 'no-var': 'error', 'prefer-const': 'error' }, parserOptions: { ecmaVersion: 6 } }; parse5-6.0.1/.gitattributes 0000664 0000000 0000000 00000000222 13706575615 0015623 0 ustar 00root root 0000000 0000000 # Exclude the HTML files from GitHub's language statistics # https://github.com/github/linguist#using-gitattributes test/data/* linguist-vendored parse5-6.0.1/.gitignore 0000664 0000000 0000000 00000000175 13706575615 0014727 0 ustar 00root root 0000000 0000000 .DS_Store .idea .vscode node_modules docs/build docs/05_api_reference.md package-lock.json bench/package-lock.json .DS_Store parse5-6.0.1/.gitmodules 0000664 0000000 0000000 00000000202 13706575615 0015103 0 ustar 00root root 0000000 0000000 [submodule "test/data/html5lib-tests"] path = test/data/html5lib-tests url = https://github.com/HTMLParseErrorWG/html5lib-tests parse5-6.0.1/.prettierignore 0000664 0000000 0000000 00000000070 13706575615 0015774 0 ustar 00root root 0000000 0000000 packages/parse5/lib/tokenizer/named-entity-data.js docs parse5-6.0.1/.prettierrc 0000664 0000000 0000000 00000000056 13706575615 0015121 0 ustar 00root root 0000000 0000000 printWidth: 120 tabWidth: 4 singleQuote: true parse5-6.0.1/.travis.yml 0000664 0000000 0000000 00000000062 13706575615 0015043 0 ustar 00root root 0000000 0000000 language: node_js sudo: false node_js: - stable parse5-6.0.1/LICENSE 0000664 0000000 0000000 00000002125 13706575615 0013741 0 ustar 00root root 0000000 0000000 Copyright (c) 2013-2019 Ivan Nikulin (ifaaan@gmail.com, https://github.com/inikulin) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. parse5-6.0.1/README.md 0000664 0000000 0000000 00000003300 13706575615 0014207 0 ustar 00root root 0000000 0000000
HTML parsing/serialization toolset for Node.js. WHATWG HTML Living Standard (aka HTML5)-compliant.
parse5 provides nearly everything you may need when dealing with HTML. It's the fastest spec-compliant HTML parser for Node to date. It parses HTML the way the latest version of your browser does. It has proven itself reliable in such projects as jsdom, Angular2, Polymer and many more.
---List of parse5 toolset packages
parse5-6.0.1/bench/ 0000775 0000000 0000000 00000000000 13706575615 0014013 5 ustar 00root root 0000000 0000000 parse5-6.0.1/bench/.eslintrc.js 0000664 0000000 0000000 00000000232 13706575615 0016247 0 ustar 00root root 0000000 0000000 module.exports = { extends: ['../.eslintrc.js'], rules: { 'no-console': 'off' }, parserOptions: { ecmaVersion: 8 } }; parse5-6.0.1/bench/memory/ 0000775 0000000 0000000 00000000000 13706575615 0015323 5 ustar 00root root 0000000 0000000 parse5-6.0.1/bench/memory/named-entity-data.js 0000664 0000000 0000000 00000000521 13706575615 0021164 0 ustar 00root root 0000000 0000000 'use strict'; const format = require('human-format'); main(); function main() { const before = process.memoryUsage().rss; require('../../packages/parse5/lib/tokenizer/named-entity-data'); const after = process.memoryUsage().rss; console.log('Initial memory consumption: ', format(after - before, { unit: 'B' })); } parse5-6.0.1/bench/memory/sax-parser.js 0000664 0000000 0000000 00000003725 13706575615 0017755 0 ustar 00root root 0000000 0000000 'use strict'; const fs = require('fs'); const format = require('human-format'); const promisifyEvent = require('promisify-event'); const memwatch = require('node-memwatch'); const SAXParser = require('../../packages/parse5-sax-parser/lib'); main(); async function main() { let parsedDataSize = 0; let maxMemUsage = 0; let startDate = null; let endDate = null; const heapDiffMeasurement = new memwatch.HeapDiff(); let heapDiff = null; memwatch.on('stats', stats => { maxMemUsage = Math.max(maxMemUsage, stats['current_base']); }); startDate = new Date(); const parserPromise = parse().then(dataSize => { parsedDataSize = dataSize; endDate = new Date(); heapDiff = heapDiffMeasurement.end(); }); await Promise.all([ parserPromise, promisifyEvent(memwatch, 'stats') // NOTE: we need at least one `stats` result ]); printResults(parsedDataSize, startDate, endDate, heapDiff, maxMemUsage); } async function parse() { const data = fs.readFileSync('../test/data/huge-page/huge-page.html', 'utf8'); let parsedDataSize = 0; const stream = new SAXParser(); for (let i = 0; i < 200; i++) { parsedDataSize += data.length; stream.write(data); } stream.end(); await promisifyEvent(stream, 'finish'); return parsedDataSize; } function getDuration(startDate, endDate) { const scale = new format.Scale({ seconds: 1, minutes: 60, hours: 3600 }); return format((endDate - startDate) / 1000, { scale: scale }); } function printResults(parsedDataSize, startDate, endDate, heapDiff, maxMemUsage) { console.log('Input data size:', format(parsedDataSize, { unit: 'B' })); console.log('Duration: ', getDuration(startDate, endDate)); console.log('Memory before: ', heapDiff.before.size); console.log('Memory after: ', heapDiff.after.size); console.log('Memory max: ', format(maxMemUsage, { unit: 'B' })); } parse5-6.0.1/bench/package.json 0000664 0000000 0000000 00000000562 13706575615 0016304 0 ustar 00root root 0000000 0000000 { "name": "parse5-benchmarks", "version": "1.0.0", "description": "parse5 regression benchmarks", "author": "Ivan Nikulin