{"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"bugs":{"url":"https://github.com/wooorm/html-element-attributes/issues"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"}],"description":"Map of HTML elements to allowed attributes","devDependencies":{"@types/node":"^24.0.0","c8":"^10.0.0","hast-util-from-html":"^2.0.0","hast-util-select":"^6.0.0","hast-util-to-string":"^3.0.0","prettier":"^3.0.0","remark-cli":"^12.0.0","remark-preset-wooorm":"^11.0.0","type-coverage":"^2.0.0","typescript":"^5.0.0","undici":"^7.0.0","xo":"^1.0.0"},"funding":{"type":"github","url":"https://github.com/sponsors/wooorm"},"keywords":["attribute","element","html","name","property","tag","w3c","whatwg"],"license":"MIT","main":"index.js","name#":"to do: next major: use `exports`","name":"html-element-attributes","prettier":{"bracketSpacing":false,"semi":false,"singleQuote":true,"tabWidth":2,"trailingComma":"none","useTabs":false},"remarkConfig":{"plugins":["preset-wooorm"]},"repository":{"type":"git","url":"git+https://github.com/wooorm/html-element-attributes.git"},"scripts":{"build":"tsc --build --clean && tsc --build && type-coverage","prepack":"npm run build && npm run format","format":"remark --frail --output --quiet -- . && prettier --log-level warn --write -- . && xo --fix","generate":"node --conditions development build.js","test-api":"node --conditions development test.js","test-coverage":"c8 --100 --reporter lcov -- npm run test-api","test":"npm run generate && npm run build && npm run format && npm run test-coverage"},"sideEffects":false,"typeCoverage":{"atLeast":100,"ignoreCatch":true},"types#":"to do: next major: remove","types":"index.d.ts","type":"module","version":"3.5.0","xo":{"prettier":true,"rules":{"unicorn/prefer-string-replace-all":"off"},"space":true},"_id":"html-element-attributes@3.5.0","gitHead":"90784de761f4ef808eb115f1bb14f7b60c91e620","homepage":"https://github.com/wooorm/html-element-attributes#readme","_nodeVersion":"23.9.0","_npmVersion":"11.4.2","dist":{"integrity":"sha512-rU2BFhp0kQla9sqPBI46C+zbP6PFOtD7z6XNAJ6as+cGecCDXLx0W3aIs6XdPLmBBG/Fy1meRi/n65Exofz4Qw==","shasum":"355a3890005201031046b79a55c9b04f696bb135","tarball":"http://registry-npm.ywwl.com/html-element-attributes/download/html-element-attributes-3.5.0.tgz","fileCount":6,"unpackedSize":15081,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCtTgvqlk9UesdwDUbu2XhyWcmUMa8Z1cIz/0NycFW0kAIhAJwL1YsDPgEIIXdOlXbcLrUw+fUvk0ScIXe9rwtliN3Z"}],"size":5084,"noattachment":false,"key":"/html-element-attributes/-/html-element-attributes-3.5.0.tgz"},"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/html-element-attributes_3.5.0_1753727846115_0.6731123982303409"},"_hasShrinkwrap":false,"readme":"# html-element-attributes\n\n[![Build][badge-build-image]][badge-build-url]\n[![Coverage][badge-coverage-image]][badge-coverage-url]\n[![Downloads][badge-downloads-image]][badge-downloads-url]\n[![Size][badge-size-image]][badge-size-url]\n\nMap of HTML elements to allowed attributes.\n\n## Contents\n\n* [What is this?](#what-is-this)\n* [When should I use this?](#when-should-i-use-this)\n* [Install](#install)\n* [Use](#use)\n* [API](#api)\n  * [`htmlElementAttributes`](#htmlelementattributes)\n* [Types](#types)\n* [Compatibility](#compatibility)\n* [Security](#security)\n* [Related](#related)\n* [Contribute](#contribute)\n* [License](#license)\n\n## What is this?\n\nThis is a map of tag names to lists of allowed attributes.\nGlobal attributes are stored at the special tag name `*`.\nAll attributes from HTML 4 and the current living HTML spec are included.\n\n> 👉 **Note**: Includes deprecated attributes.\n\n> 👉 **Note**: Attributes which were not global in HTML 4 but are in HTML, are\n> only included in the list of global attributes.\n\n## When should I use this?\n\nYou can use this to figure out if certain attributes are allowed on certain\nHTML elements.\n\n## Install\n\nThis package is [ESM only][github-gist-esm].\nIn Node.js (version 14.14+, 16.0+), install with [npm][npmjs-install]:\n\n```sh\nnpm install html-element-attributes\n```\n\nIn Deno with [`esm.sh`][esmsh]:\n\n```js\nimport {htmlElementAttributes} from 'https://esm.sh/html-element-attributes@3'\n```\n\nIn browsers with [`esm.sh`][esmsh]:\n\n```html\n<script type=\"module\">\n  import {htmlElementAttributes} from 'https://esm.sh/html-element-attributes@3?bundle'\n</script>\n```\n\n## Use\n\n```js\nimport {htmlElementAttributes} from 'html-element-attributes'\n\nconsole.log(htmlElementAttributes['*'])\nconsole.log(htmlElementAttributes.ol)\n```\n\nYields:\n\n```js\n[\n  'accesskey',\n  'autocapitalize',\n  'autofocus',\n  'class',\n  // …\n  'style',\n  'tabindex',\n  'title',\n  'translate'\n]\n['compact', 'reversed', 'start', 'type']\n```\n\n## API\n\nThis package exports the identifier `htmlElementAttributes`.\nThere is no default export.\n\n### `htmlElementAttributes`\n\nMap of lowercase HTML elements to allowed attributes\n(`Record<string, Array<string>>`).\n\n## Types\n\nThis package is fully typed with [TypeScript][].\nIt exports no additional types.\n\n## Compatibility\n\nThis package is at least compatible with all maintained versions of Node.js.\nAs of now, that is Node.js 14.14+ and 16.0+.\nIt also works in Deno and modern browsers.\n\n## Security\n\nThis package is safe.\n\n## Related\n\n* [`wooorm/web-namespaces`](https://github.com/wooorm/web-namespaces)\n  — list of web namespaces\n* [`wooorm/html-tag-names`](https://github.com/wooorm/html-tag-names)\n  — list of HTML tag names\n* [`wooorm/mathml-tag-names`](https://github.com/wooorm/mathml-tag-names)\n  — list of MathML tag names\n* [`wooorm/svg-tag-names`](https://github.com/wooorm/svg-tag-names)\n  — list of SVG tag names\n* [`wooorm/html-void-elements`](https://github.com/wooorm/html-void-elements)\n  — list of void HTML tag names\n* [`wooorm/svg-element-attributes`](https://github.com/wooorm/svg-element-attributes)\n  — map of SVG elements to attributes\n* [`wooorm/aria-attributes`](https://github.com/wooorm/aria-attributes)\n  — list of ARIA attributes\n\n## Contribute\n\nYes please!\nSee [How to Contribute to Open Source][opensource-guide].\n\n## License\n\n[MIT][file-license] © [Titus Wormer][wooorm]\n\n<!-- Definition -->\n\n[badge-build-image]: https://github.com/wooorm/html-element-attributes/workflows/main/badge.svg\n\n[badge-build-url]: https://github.com/wooorm/html-element-attributes/actions\n\n[badge-coverage-image]: https://img.shields.io/codecov/c/github/wooorm/html-element-attributes.svg\n\n[badge-coverage-url]: https://codecov.io/github/wooorm/html-element-attributes\n\n[badge-downloads-image]: https://img.shields.io/npm/dm/html-element-attributes.svg\n\n[badge-downloads-url]: https://www.npmjs.com/package/html-element-attributes\n\n[badge-size-image]: https://img.shields.io/bundlejs/size/html-element-attributes\n\n[badge-size-url]: https://bundlejs.com/?q=html-element-attributes\n\n[esmsh]: https://esm.sh\n\n[file-license]: license\n\n[github-gist-esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c\n\n[npmjs-install]: https://docs.npmjs.com/cli/install\n\n[opensource-guide]: https://opensource.guide/how-to-contribute/\n\n[typescript]: https://www.typescriptlang.org\n\n[wooorm]: https://wooorm.com\n","publish_time":1753727846293,"_cnpm_publish_time":1753727846293,"dist-tags":{"latest":"3.5.0"}}