Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
svg-element-attributes
Advanced tools
Map of SVG elements to allowed attributes.
This is a map of tag names to lists of allowed attributes.
Global attributes are stored at the special tag name *
.
All attributes from SVG 1.1, SVG Tiny 1.2, and SVG 2 are
included.
👉 Note: Includes deprecated attributes.
👉 Note: ARIA (
role
,aria-*
), event (ev:event
,on*
), orxml:*
andxlink:*
attributes are not included.
You can use this to figure out if certain attributes are allowed on certain SVG elements.
This package is ESM only. In Node.js (version 14.14+, 16.0+), install with npm:
npm install svg-element-attributes
In Deno with esm.sh
:
import {svgElementAttributes} from 'https://esm.sh/svg-element-attributes@2'
In browsers with esm.sh
:
<script type="module">
import {svgElementAttributes} from 'https://esm.sh/svg-element-attributes@2?bundle'
</script>
import {svgElementAttributes} from 'svg-element-attributes'
console.log(svgElementAttributes['*'])
console.log(svgElementAttributes.circle)
Yields:
[
'about',
'class',
'content',
'datatype',
'id',
'lang',
'property',
'rel',
'resource',
'rev',
'tabindex',
'typeof' ]
[
'alignment-baseline',
'baseline-shift',
'clip',
'clip-path',
'clip-rule',
// …
'transform',
'unicode-bidi',
'visibility',
'word-spacing',
'writing-mode' ]
This package exports the identifier svgElementAttributes
.
There is no default export.
svgElementAttributes
Map of lowercase SVG elements to allowed attributes
(Record<string, Array<string>>
).
This package is fully typed with TypeScript. It exports no additional types.
This package is at least compatible with all maintained versions of Node.js. As of now, that is Node.js 14.14+ and 16.0+. It also works in Deno and modern browsers.
This package is safe.
wooorm/web-namespaces
— list of web namespaceswooorm/html-tag-names
— list of HTML tag nameswooorm/mathml-tag-names
— list of MathML tag nameswooorm/svg-tag-names
— list of SVG tag nameswooorm/html-void-elements
— list of void HTML tag nameswooorm/html-element-attributes
— map of HTML elements to attributeswooorm/aria-attributes
— list of ARIA attributesYes please! See How to Contribute to Open Source.
FAQs
Map of SVG elements to allowed attributes
The npm package svg-element-attributes receives a total of 85,249 weekly downloads. As such, svg-element-attributes popularity was classified as popular.
We found that svg-element-attributes demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.