{"_id":"posthtml-attrs-parser","_rev":"13-f8df5a12722b1fdb7e4f311ca6ee88f4","name":"posthtml-attrs-parser","dist-tags":{"old-stable":"0.1.2","latest":"1.1.2"},"versions":{"0.1.0":{"name":"posthtml-attrs-parser","version":"0.1.0","keywords":["posthtml","posthtml-plugin","html","postproccessor","parser"],"author":{"name":"Kirill Maltsev","email":"maltsevkirill@gmail.com"},"license":"MIT","_id":"posthtml-attrs-parser@0.1.0","maintainers":[{"name":"maltsev","email":"maltsevkirill@gmail.com"}],"homepage":"https://github.com/maltsev/posthtml-attrs-parser","bugs":{"url":"https://github.com/maltsev/posthtml-attrs-parser/issues"},"dist":{"shasum":"27cb7ba3866ef9b33dcfa08d4855eb6873fc290b","tarball":"https://registry.npmjs.org/posthtml-attrs-parser/-/posthtml-attrs-parser-0.1.0.tgz","integrity":"sha512-tPT7hwhjRhaZeIt2hcY7VO7+zIVv0OKz6l2loIj5Dj/ZT2cWtDq+GAYq2rFqQy3MGbIV4DrcZalgizpT+DE/pQ==","signatures":[{"sig":"MEUCIBeHI9m4wuZEVzoLE96jzK/kdEUsIxCqLQvSqNNY36eFAiEAq2VyoGjazglkL3OC+6kSVhIJ7XKUN6DIlL2W7qtLDQw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_from":".","babel":{"presets":["es2015"]},"_shasum":"27cb7ba3866ef9b33dcfa08d4855eb6873fc290b","gitHead":"bae45dee815f866838ff80b67b35822a46003d37","scripts":{"lint":"eslint *.js lib/*.es6 test/","test":"_mocha --compilers js:babel-core/register","compile":"rm -f lib/*.js && node_modules/.bin/babel -d lib/ lib/","pretest":"npm run lint && npm run compile","prepublish":"npm run compile"},"_npmUser":{"name":"maltsev","email":"maltsevkirill@gmail.com"},"repository":{"url":"git://github.com/maltsev/posthtml-attrs-parser.git","type":"git"},"_npmVersion":"2.7.6","description":"PostHTML helper that gives a better API to work with tag's attrs","directories":{},"_nodeVersion":"1.7.1","dependencies":{"object-assign":"^4.0.1"},"devDependencies":{"mocha":"^2.3.4","eslint":"^1.10.3","expect":"^1.13.0","posthtml":"^0.8.0","babel-cli":"^6.3.15","babel-core":"^6.3.15","babel-eslint":"^4.1.6","babel-preset-es2015":"^6.3.13"}},"0.1.1":{"name":"posthtml-attrs-parser","version":"0.1.1","keywords":["posthtml","posthtml-plugin","html","postproccessor","parser"],"author":{"name":"Kirill Maltsev","email":"maltsevkirill@gmail.com"},"license":"MIT","_id":"posthtml-attrs-parser@0.1.1","maintainers":[{"name":"maltsev","email":"maltsevkirill@gmail.com"}],"homepage":"https://github.com/maltsev/posthtml-attrs-parser","bugs":{"url":"https://github.com/maltsev/posthtml-attrs-parser/issues"},"dist":{"shasum":"cc33e00155fb99ba96f67e25e330461f05742ac8","tarball":"https://registry.npmjs.org/posthtml-attrs-parser/-/posthtml-attrs-parser-0.1.1.tgz","integrity":"sha512-ZFZfTIb74uHFdn80+7DyP+qrryDX/Bb7Q2rUaByh6iUJ1HlKGSxkChKORpwIUHjChJDzcKEtnyXxzXzcjpH9CQ==","signatures":[{"sig":"MEUCIB08Qay26aCGCciO8GUVHQIdB1BiKopF5RXXrp7NOuOlAiEAuj5Ewq6JaR1z6EB8sv5zFJBMfWFn/RLpfHchGtczZWM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_from":".","babel":{"presets":["es2015"]},"_shasum":"cc33e00155fb99ba96f67e25e330461f05742ac8","gitHead":"085bfc2ea5d1d004cc8b4f091420f072425fb506","scripts":{"lint":"eslint *.js lib/*.es6 test/","test":"_mocha --compilers js:babel-core/register","compile":"rm -f lib/*.js && node_modules/.bin/babel -d lib/ lib/","pretest":"npm run lint && npm run compile","prepublish":"npm run compile"},"_npmUser":{"name":"maltsev","email":"maltsevkirill@gmail.com"},"repository":{"url":"git://github.com/maltsev/posthtml-attrs-parser.git","type":"git"},"_npmVersion":"2.7.6","description":"PostHTML helper that gives a better API to work with tag's attrs","directories":{},"_nodeVersion":"1.7.1","dependencies":{"object-assign":"^4.0.1"},"devDependencies":{"mocha":"^2.3.4","eslint":"^1.10.3","expect":"^1.13.0","posthtml":"^0.8.0","babel-cli":"^6.3.15","babel-core":"^6.3.15","babel-eslint":"^4.1.6","babel-preset-es2015":"^6.3.13"}},"1.0.0":{"name":"posthtml-attrs-parser","version":"1.0.0","keywords":["posthtml","posthtml-plugin","html","post-processor","parser","attributes"],"author":{"name":"Kirill Maltsev","email":"maltsevkirill@gmail.com"},"license":"MIT","_id":"posthtml-attrs-parser@1.0.0","maintainers":[{"name":"scrum","email":"scrum@list.ru"},{"name":"maltsev","email":"maltsevkirill@gmail.com"}],"homepage":"https://github.com/posthtml/posthtml-attrs-parser","bugs":{"url":"https://github.com/posthtml/posthtml-attrs-parser/issues"},"dist":{"shasum":"98c80e4ab1474551e71699e0fc947338bfbd56d3","tarball":"https://registry.npmjs.org/posthtml-attrs-parser/-/posthtml-attrs-parser-1.0.0.tgz","fileCount":6,"integrity":"sha512-jvu0nAZEBx/D2aHdhxHHuWKe/qCvYdLELjlBQfmAwsmpRh+SKHqe9xzvAYd8m5rnlXLMvFvL1HJE8t6WAQgIBg==","signatures":[{"sig":"MEQCIBRBxMz4IZCgMMbb+6G20dCfx2ORlrLhg9WNjyH2ZmlJAiA183L7TeMlqcFf0Uw4lT9J+alMhdzA6s967K0Ypwxldg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":8536},"main":"lib/index.js","type":"module","engines":{"node":">=16.0.0"},"gitHead":"df1de8a2b282dc0350bd4c6af8e3b32e841aaa46","scripts":{"dev":"vitest","lint":"eslint lib/*.js","test":"vitest run --coverage","pretest":"npm run lint","release":"np"},"_npmUser":{"name":"maltsev","email":"maltsevkirill@gmail.com"},"repository":{"url":"git+https://github.com/posthtml/posthtml-attrs-parser.git","type":"git"},"_npmVersion":"10.2.4","description":"PostHTML helper that provides a better API to work with tag attributes.","directories":{},"_nodeVersion":"21.5.0","_hasShrinkwrap":false,"devDependencies":{"np":"^9.2.0","eslint":"^8.56.0","vitest":"^1.2.1","posthtml":"^0.16.6","@vitest/coverage-v8":"^1.2.1"},"_npmOperationalInternal":{"tmp":"tmp/posthtml-attrs-parser_1.0.0_1705862405661_0.45867597572605057","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"posthtml-attrs-parser","version":"1.0.1","keywords":["posthtml","posthtml-plugin","html","post-processor","parser","attributes"],"author":{"name":"Kirill Maltsev","email":"maltsevkirill@gmail.com"},"license":"MIT","_id":"posthtml-attrs-parser@1.0.1","maintainers":[{"name":"scrum","email":"scrum@list.ru"},{"name":"maltsev","email":"maltsevkirill@gmail.com"},{"name":"cossssmin","email":"hellocosmin@gmail.com"}],"homepage":"https://github.com/posthtml/posthtml-attrs-parser","bugs":{"url":"https://github.com/posthtml/posthtml-attrs-parser/issues"},"dist":{"shasum":"d2435b0cff4c65dfe1dd55055b66a195c21d886b","tarball":"https://registry.npmjs.org/posthtml-attrs-parser/-/posthtml-attrs-parser-1.0.1.tgz","fileCount":6,"integrity":"sha512-GEjJu/PApFm56HEQ8U2M6v5YQglS05FhXKftuuAhP8loNM6Peu1Njt1ykXWJdZ0Nq770YLql9zhvwbTW/szpWw==","signatures":[{"sig":"MEYCIQCzrIrw4omr9A0sEOIZgM9lG+5qzPlpK0WBm7eALiQ77AIhAMBb6Bp/NfUP1d5yfiBFDXbOWQKadsfy7/6rZRk6nSlo","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":8750},"main":"lib/index.js","type":"module","engines":{"node":">=16.0.0"},"gitHead":"a0e4efcb0d21aee0af6eba42fecd5d0bffef5362","scripts":{"dev":"vitest","lint":"eslint lib/*.js","test":"vitest run --coverage","pretest":"npm run lint","release":"np"},"_npmUser":{"name":"cossssmin","email":"hellocosmin@gmail.com"},"repository":{"url":"git+https://github.com/posthtml/posthtml-attrs-parser.git","type":"git"},"_npmVersion":"10.2.4","description":"PostHTML helper that provides a better API to work with tag attributes.","directories":{},"_nodeVersion":"20.10.0","_hasShrinkwrap":false,"devDependencies":{"np":"^9.2.0","eslint":"^8.56.0","vitest":"^1.2.1","posthtml":"^0.16.6","@vitest/coverage-v8":"^1.2.1"},"_npmOperationalInternal":{"tmp":"tmp/posthtml-attrs-parser_1.0.1_1706025868101_0.3288748821658569","host":"s3://npm-registry-packages"}},"0.1.2":{"name":"posthtml-attrs-parser","version":"0.1.2","keywords":["posthtml","posthtml-plugin","html","post-processor","parser","attributes"],"author":{"name":"Kirill Maltsev","email":"maltsevkirill@gmail.com"},"license":"MIT","_id":"posthtml-attrs-parser@0.1.2","maintainers":[{"name":"scrum","email":"scrum@list.ru"},{"name":"maltsev","email":"maltsevkirill@gmail.com"},{"name":"cossssmin","email":"hellocosmin@gmail.com"}],"homepage":"https://github.com/posthtml/posthtml-attrs-parser","bugs":{"url":"https://github.com/posthtml/posthtml-attrs-parser/issues"},"dist":{"shasum":"16c091c70b1f6828d22e1ad3fd6a4e48d08c0d36","tarball":"https://registry.npmjs.org/posthtml-attrs-parser/-/posthtml-attrs-parser-0.1.2.tgz","fileCount":5,"integrity":"sha512-eyyPge8w+gEhpqVZMBrevUUo4MvpePkRWSDHYyjtntdz9C3bnLpCwE9lw5rj+JXut71KuddD0i61e5KbeDy0nQ==","signatures":[{"sig":"MEYCIQDhJFgRRiKkW6XXDXfcIb1LletKCjJF3B4x540lTLQ12QIhAOEgt6Sk+ES0ZNRyOy6P8e/LKsudH197Xy7W9dHyIWQm","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":11280},"main":"dist/index.cjs","type":"module","module":"./dist/index.mjs","engines":{"node":">=16.0.0"},"exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.cjs"}},"gitHead":"7b400578c6eda0e20e45de2af71c9c752d7d663d","scripts":{"dev":"vitest","lint":"eslint lib/*.js","test":"vitest run --coverage","build":"unbuild","prepack":"unbuild","pretest":"npm run lint","release":"np"},"_npmUser":{"name":"cossssmin","email":"hellocosmin@gmail.com"},"repository":{"url":"git+https://github.com/posthtml/posthtml-attrs-parser.git","type":"git"},"_npmVersion":"10.2.4","description":"PostHTML helper that provides a better API to work with tag attributes.","directories":{},"_nodeVersion":"20.10.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"np":"^10.0.0","eslint":"^8.57.0","vitest":"^1.2.1","unbuild":"^2.0.0","posthtml":"^0.16.6","@vitest/coverage-v8":"^1.2.1"},"_npmOperationalInternal":{"tmp":"tmp/posthtml-attrs-parser_0.1.2_1712666504839_0.4554569881909978","host":"s3://npm-registry-packages"}},"1.1.0":{"name":"posthtml-attrs-parser","version":"1.1.0","keywords":["posthtml","posthtml-plugin","html","post-processor","parser","attributes"],"author":{"name":"Kirill Maltsev","email":"maltsevkirill@gmail.com"},"license":"MIT","_id":"posthtml-attrs-parser@1.1.0","maintainers":[{"name":"scrum","email":"scrum@list.ru"},{"name":"maltsev","email":"maltsevkirill@gmail.com"},{"name":"cossssmin","email":"hellocosmin@gmail.com"}],"homepage":"https://github.com/posthtml/posthtml-attrs-parser","bugs":{"url":"https://github.com/posthtml/posthtml-attrs-parser/issues"},"dist":{"shasum":"e8d798f1dbea5911c4042d565100a406e0b823e6","tarball":"https://registry.npmjs.org/posthtml-attrs-parser/-/posthtml-attrs-parser-1.1.0.tgz","fileCount":5,"integrity":"sha512-OUhvavusxyXVW+ccxE4fYekIc5XOPW9MQeW2R/i4rAGHxGLTFnz41LxhhZxADdjxej8+kY/m/N+B6tw8P2M3Vg==","signatures":[{"sig":"MEUCIQDugaTc6Ff6rljOVJUskvdUGq/+NOuj4oqyl0/cPJFueAIgCTpQCcVriUk4Y+uUAmcPWtCsgd09H4e/fmvnbjI98c4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":11268},"main":"dist/index.cjs","type":"module","module":"./dist/index.mjs","engines":{"node":">=16.0.0"},"exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.cjs"}},"gitHead":"5041377bc1946b8c87839e698de4423a9757b2d9","scripts":{"dev":"vitest","lint":"eslint lib/*.js","test":"vitest run --coverage","build":"unbuild","prepack":"unbuild","pretest":"npm run lint","release":"np"},"_npmUser":{"name":"cossssmin","email":"hellocosmin@gmail.com"},"repository":{"url":"git+https://github.com/posthtml/posthtml-attrs-parser.git","type":"git"},"_npmVersion":"10.2.4","description":"PostHTML helper that provides a better API to work with tag attributes.","directories":{},"_nodeVersion":"20.10.0","_hasShrinkwrap":false,"devDependencies":{"np":"^10.0.0","eslint":"^8.5.7","vitest":"^1.4.0","unbuild":"^2.0.0","posthtml":"^0.16.6","@vitest/coverage-v8":"^1.4.0"},"_npmOperationalInternal":{"tmp":"tmp/posthtml-attrs-parser_1.1.0_1712669157330_0.9798101169253077","host":"s3://npm-registry-packages"}},"1.1.1":{"name":"posthtml-attrs-parser","version":"1.1.1","keywords":["posthtml","posthtml-plugin","html","post-processor","parser","attributes"],"author":{"name":"Kirill Maltsev","email":"maltsevkirill@gmail.com"},"license":"MIT","_id":"posthtml-attrs-parser@1.1.1","maintainers":[{"name":"scrum","email":"scrum@list.ru"},{"name":"maltsev","email":"maltsevkirill@gmail.com"},{"name":"cossssmin","email":"hellocosmin@gmail.com"}],"homepage":"https://github.com/posthtml/posthtml-attrs-parser","bugs":{"url":"https://github.com/posthtml/posthtml-attrs-parser/issues"},"dist":{"shasum":"fc5c3d25e6be4fcf309db6f7ecfd7ec50ebbfbee","tarball":"https://registry.npmjs.org/posthtml-attrs-parser/-/posthtml-attrs-parser-1.1.1.tgz","fileCount":5,"integrity":"sha512-yWD1JGaLr5ENrEhUxjqEuSjTkYhX3VVK3ULNeh9Xs+Jqr3c0UGVkerxJg55Uyu036jm5nMsG6rJaBtE5YSf+lw==","signatures":[{"sig":"MEUCIQD/8Xqgl9xI/Hfoe1MX0+ier9wCND5sjgEASB7QO3RTGgIgfLS5/VIPmLy7i2B8GfzCRegG3L4eJIaTRBXjbuQlQQw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":11275},"main":"dist/index.cjs","type":"module","module":"./dist/index.mjs","engines":{"node":">=16.0.0"},"exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.cjs"}},"gitHead":"e52c85660b00fce8b5890c1d2e3d1dff0bcc7c57","scripts":{"dev":"vitest","lint":"biome lint ./lib","test":"vitest run --coverage","build":"unbuild","prepack":"unbuild","pretest":"npm run lint","release":"npx np"},"_npmUser":{"name":"cossssmin","email":"hellocosmin@gmail.com"},"repository":{"url":"git+https://github.com/posthtml/posthtml-attrs-parser.git","type":"git"},"_npmVersion":"10.2.4","description":"PostHTML helper that provides a better API to work with tag attributes.","directories":{},"_nodeVersion":"20.10.0","_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.0.1","unbuild":"^2.0.0","posthtml":"^0.16.6","@biomejs/biome":"1.8.3","@vitest/coverage-v8":"^2.0.1"},"_npmOperationalInternal":{"tmp":"tmp/posthtml-attrs-parser_1.1.1_1721048933307_0.6437221863249336","host":"s3://npm-registry-packages"}},"1.1.2":{"name":"posthtml-attrs-parser","version":"1.1.2","description":"PostHTML helper that provides a better API to work with tag attributes.","type":"module","exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.cjs"}},"main":"dist/index.cjs","module":"./dist/index.mjs","author":{"name":"Kirill Maltsev","email":"maltsevkirill@gmail.com"},"license":"MIT","scripts":{"dev":"vitest","release":"npx np","build":"unbuild","prepack":"unbuild","lint":"biome lint ./lib","pretest":"npm run lint","test":"vitest run --coverage"},"keywords":["posthtml","posthtml-plugin","html","post-processor","parser","attributes"],"devDependencies":{"@biomejs/biome":"1.9.4","@vitest/coverage-v8":"^2.0.1","posthtml":"^0.16.6","unbuild":"^2.0.0","vitest":"^2.0.1"},"engines":{"node":">=16.0.0"},"repository":{"type":"git","url":"git+https://github.com/posthtml/posthtml-attrs-parser.git"},"bugs":{"url":"https://github.com/posthtml/posthtml-attrs-parser/issues"},"homepage":"https://github.com/posthtml/posthtml-attrs-parser","_id":"posthtml-attrs-parser@1.1.2","gitHead":"d008a4ea981971a0cadd6e520ab2c7d4caaa46e3","_nodeVersion":"20.10.0","_npmVersion":"10.2.4","dist":{"integrity":"sha512-9Que9y4k8c33iv8h5QyTfHKlurmsJIscozy7oeFRxuWeX/osXjVGu9o9MKrmo4TI6Vr9a9vh9b4LYXqm3/GvhA==","shasum":"19ce48cdbe0bbb92b4ddbbda44fed3b0d7bafe3b","tarball":"https://registry.npmjs.org/posthtml-attrs-parser/-/posthtml-attrs-parser-1.1.2.tgz","fileCount":5,"unpackedSize":11275,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHnh1sTlomUHkBg8WZv33uzn1shKeCSUj1N7IcR60PocAiEApa4F0nQP1DemYifJTQTEavT2EDKADXF+weLQrFpzXEM="}]},"_npmUser":{"name":"cossssmin","email":"hellocosmin@gmail.com"},"directories":{},"maintainers":[{"name":"scrum","email":"scrum@list.ru"},{"name":"maltsev","email":"maltsevkirill@gmail.com"},{"name":"cossssmin","email":"hellocosmin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/posthtml-attrs-parser_1.1.2_1734364958565_0.525314341716473"},"_hasShrinkwrap":false}},"time":{"created":"2015-12-10T15:05:52.986Z","modified":"2024-12-16T16:02:38.959Z","0.1.0":"2015-12-10T15:05:52.986Z","0.1.1":"2016-01-04T22:25:00.605Z","1.0.0":"2024-01-21T18:40:05.863Z","1.0.1":"2024-01-23T16:04:28.245Z","0.1.2":"2024-04-09T12:41:45.006Z","1.1.0":"2024-04-09T13:25:57.499Z","1.1.1":"2024-07-15T13:08:53.475Z","1.1.2":"2024-12-16T16:02:38.780Z"},"bugs":{"url":"https://github.com/posthtml/posthtml-attrs-parser/issues"},"author":{"name":"Kirill Maltsev","email":"maltsevkirill@gmail.com"},"license":"MIT","homepage":"https://github.com/posthtml/posthtml-attrs-parser","keywords":["posthtml","posthtml-plugin","html","post-processor","parser","attributes"],"repository":{"type":"git","url":"git+https://github.com/posthtml/posthtml-attrs-parser.git"},"description":"PostHTML helper that provides a better API to work with tag attributes.","maintainers":[{"name":"scrum","email":"scrum@list.ru"},{"name":"maltsev","email":"maltsevkirill@gmail.com"},{"name":"cossssmin","email":"hellocosmin@gmail.com"}],"readme":"<div align=\"center\">\n  <img width=\"150\" height=\"150\" alt=\"PostHTML\" src=\"https://posthtml.github.io/posthtml/logo.svg\">\n  <h1>posthtml-attrs-parser</h1>\n  <p>PostHTML plugin for parsing HTML attributes</p>\n\n  [![Version][npm-version-shield]][npm]\n  [![Build][github-ci-shield]][github-ci]\n  [![License][license-shield]][license]\n  [![Downloads][npm-stats-shield]][npm-stats]\n</div>\n\n[npm]: https://www.npmjs.com/package/posthtml-attrs-parser\n[npm-version-shield]: https://img.shields.io/npm/v/posthtml-attrs-parser\n[npm-stats]: http://npm-stat.com/charts.html?package=posthtml-attrs-parser\n[npm-stats-shield]: https://img.shields.io/npm/dt/posthtml-attrs-parser.svg\n[github-ci]: https://github.com/posthtml/posthtml-attrs-parser/actions/workflows/nodejs.yml\n[github-ci-shield]: https://github.com/posthtml/posthtml-attrs-parser/actions/workflows/nodejs.yml/badge.svg\n[license]: ./license\n[license-shield]: https://img.shields.io/npm/l/posthtml-attrs-parser.svg\n\nA [PostHTML](https://github.com/posthtml/posthtml) helper plugin that provides a better API for working with tag attributes.\n\n## Usage\n```js\nimport posthtml from 'posthtml';\nimport parseAttrs from 'posthtml-attrs-parser';\n\nposthtml()\n  .use(function (tree) {\n    const div = tree[0];\n    const attrs = parseAttrs(div.attrs);\n\n    attrs.style['font-size'] = '15px';\n    attrs.class.push('title-sub');\n\n    // Compose attributes back to PostHTML-compatible format\n    div.attrs = attrs.compose();\n  })\n  .process('<div class=\"title\" style=\"font-size: 14px\">Hello!</div>')\n  .then(function (result) {\n    console.log(result.html);\n  });\n\n// <div class=\"title title-sub\" style=\"font-size: 15px\">Hello!</div>\n```\n\nBoth ESM and CJS exports are provided, you can use the plugin in CJS too:\n\n```js\nconst posthtml = require('posthtml');\nconst parseAttrs = require('posthtml-attrs-parser');\n\n// ...\n```\n\n## Attributes\n\nOnly `style` and `class` attributes are parsed by default (as object and array, respectively). For other attributes, the parsing rules should be specified (see [Custom parsing rule](#custom-parsing-rule) below).\n\n### Default attributes\n\n#### `style`\n\n```html\n<div style=\"color: red; font-size: 14px; color: blue\"></div>\n```\n```js\nconst attrs = parseAttrs(div.attrs);\n\nconsole.log(attrs.style);\n/*\n{\n  // If there are several properties with the same name,\n  // the values are packed in array\n  'color': ['red', 'blue'],\n  'font-size': '14px'\n}\n*/\n```\n\n#### `class`\n\n```html\n<div class=\"title title-sub\"></div>\n```\n```js\nconst attrs = parseAttrs(div.attrs);\n\nconsole.log(attrs.class);\n// ['title', 'title-sub']\n```\n\n### Custom parsing rule\n\nYou may also define the parsing rule for other attributes.\n\n#### Array-like attribute\n\n```html\n<div data-ids=\"1  2 4 5   6\"></div>\n```\n```js\nconst attrs = parseAttrs(div.attrs, {\n  rules: {\n  'data-ids': {\n    delimiter: /\\s+/,\n    // Optional parameter for stringifying attribute's values\n    // If not set, glue = delimiter\n    glue: ' '\n  }\n}\n});\n\nconsole.log(attrs['data-ids']);\n// ['1', '2', '4', '5', '6']\n\nconsole.log(attrs.compose()['data-ids']);\n// 1 2 3 4 5 6\n```\n\n#### Object-like attribute\n\n```html\n<div data-config=\"TEST=1;ENV=debug;PATH=.\"></div>\n```\n```js\nconst attrs = parseAttrs(div.attrs, {\n  rules: {\n    'data-config': {\n      // Delimiter for key-value pairs\n      delimiter: ';',\n      // Delimiter for a key-value\n      keyDelimiter: '=',\n      // Optional parameter for stringifying key-value pairs\n      // If not set, keyGlue = keyDelimiter\n      glue: '; ',\n      // Optional parameter for stringifying a key-value\n      // If not set, glue = delimiter\n      keyGlue: ' = '\n    }\n  }\n});\n\nconsole.log(attrs['data-config']);\n// {TEST: '1', ENV: 'debug', PATH: '.'}\n\nconsole.log(attrs.compose()['data-config']);\n// TEST = 1; ENV = debug; PATH = .\n```\n","readmeFilename":"README.md"}