UNPKG

@inst/vscode-bin-darwin

Version:

BINARY ONLY - VSCode binary deployment for macOS

83 lines (82 loc) 5.18 kB
{ "_args": [ [ { "raw": "@emmetio/html-matcher@https://registry.npmjs.org/@emmetio/html-matcher/-/html-matcher-0.3.2.tgz", "scope": "@emmetio", "escapedName": "@emmetio%2fhtml-matcher", "name": "@emmetio/html-matcher", "rawSpec": "https://registry.npmjs.org/@emmetio/html-matcher/-/html-matcher-0.3.2.tgz", "spec": "https://registry.npmjs.org/@emmetio/html-matcher/-/html-matcher-0.3.2.tgz", "type": "remote" }, "/Users/code/tfs/agent3/_work/2/s/extensions/emmet" ] ], "_from": "@emmetio/html-matcher@>=0.3.1 <0.4.0", "_id": "@emmetio/html-matcher@0.3.2", "_inCache": true, "_location": "/@emmetio/html-matcher", "_phantomChildren": {}, "_requested": { "raw": "@emmetio/html-matcher@https://registry.npmjs.org/@emmetio/html-matcher/-/html-matcher-0.3.2.tgz", "scope": "@emmetio", "escapedName": "@emmetio%2fhtml-matcher", "name": "@emmetio/html-matcher", "rawSpec": "https://registry.npmjs.org/@emmetio/html-matcher/-/html-matcher-0.3.2.tgz", "spec": "https://registry.npmjs.org/@emmetio/html-matcher/-/html-matcher-0.3.2.tgz", "type": "remote" }, "_requiredBy": [ "/" ], "_resolved": "https://registry.npmjs.org/@emmetio/html-matcher/-/html-matcher-0.3.2.tgz", "_shasum": "efe0023e97191de1639f01fdcf0a198b588d3624", "_shrinkwrap": null, "_spec": "@emmetio/html-matcher@https://registry.npmjs.org/@emmetio/html-matcher/-/html-matcher-0.3.2.tgz", "_where": "/Users/code/tfs/agent3/_work/2/s/extensions/emmet", "author": { "name": "Sergey Chikuyonok", "email": "serge.che@gmail.com" }, "bugs": { "url": "https://github.com/emmetio/html-matcher/issues" }, "dependencies": { "@emmetio/stream-reader": "^2.0.0", "@emmetio/stream-reader-utils": "^0.1.0" }, "description": "Minimalistic and ultra-fast HTML parser & matcher", "devDependencies": { "babel-plugin-transform-es2015-modules-commonjs": "^6.23.0", "babel-register": "^6.23.0", "htmlparser-benchmark": "^1.1.3", "htmlparser2": "^3.9.2", "mocha": "^3.2.0", "rollup": "^0.41.6", "rollup-watch": "^3.2.2" }, "directories": { "test": "test" }, "homepage": "https://github.com/emmetio/html-matcher#readme", "keywords": [], "license": "ISC", "main": "dist/html-matcher.cjs.js", "module": "dist/html-matcher.es.js", "name": "@emmetio/html-matcher", "optionalDependencies": {}, "readme": "# Minimalistic and ultra-fast HTML parser & matcher\n\nThe goal of this project is to provide minimalistic and fast HTML/XML parser with that holds source mapping of matched tags and its attributes. The project is optimized for finding HTML/XML tag pairs from arbitrary position in source code. Also, it can be used for parsing full document into DOM.\n\nExample:\n\n```js\nimport { findPair } from '@emmetio/html-matcher';\n\nconst content = '<div><a href=\"http://emmet.io\">Example</a></div>';\n\n// find tag pair at character 35\nconst match = findPair(content, 35);\n\nconsole.log(m.type); // \"tag\", may also return \"comment\"\nconsole.log(m.start); // { cursor: 0, pos: 5 }\nconsole.log(m.end); // { cursor: 0, pos: 42 }\n\n// get open and close parts\nconsole.log(m.open.name.value); // \"a\"\nconsole.log(m.open.name.start); // { cursor: 0, pos: 6 }\nconsole.log(m.open.name.end); // { cursor: 0, pos: 7 }\n```\n\nAll token locations are represented as `{cursor, pos}` object where `cursor` is a pointer to a code chunk in content reader and `pos` is a character location in given code chunk (see below).\n\n## Content Reader\n\nHTML Matcher is designed to work inside text editors. Most editors holds source code as a set of code chunks (lines of code in most cases) to optimize its parsing and rendering. Getting a full source code from editor might be very resource-consuming, especially on large files.\n\nTo overcome this problem, you may pass *content reader* instead of string as data source. Content reader is an object with the following interface:\n\n```js\nconst lines = 'foo\\nbar\\nbaz'.split('\\n').map(line => line + '\\n');\n\nconst contentReader = {\n\tcursor: 0, // a pointer to a data chunk\n\n\t// Returns a code chunk for given cursor\n\tcharCodeAt(cursor, pos) {\n\t\treturn lines[cursor].charCodeAt(pos);\n\t}\n\n\t// Returns length of code chunk, identified by `cursor`\n\tlength(cursor) {\n\t\treturn lines[cursor].length;\n\t}\n\n\tsubstring(from, to) {\n\t\t\n\t}\n\n\t// Returns cursor for next code chunk from given cursor\n\t// or `null` if there’s no next chunk\n\tnext(cursor) {\n\t\tcursor++;\n\t\treturn cursor < lines.length ? cursor : null;\n\t}\n\n\t// Returns cursor for previous code chunk from given cursor\n\t// or `null` if there’s no previous chunk\n\tprev(cursor) {\n\t\tcursor--;\n\t\treturn cursor >= 0 ? cursor : null;\n\t}\n}\n```\n\n*TBD*\n", "readmeFilename": "README.md", "repository": { "type": "git", "url": "git+https://github.com/emmetio/html-matcher.git" }, "scripts": { "build": "rollup -c", "prepublish": "npm run test && npm run build", "test": "mocha", "watch": "rollup -wc" }, "version": "0.3.2" }