@achmadk/void-elements
v1.0.0
Published
"void-elements" with TypeScript and ES Module support. Array of "void elements" defined by the HTML specification.
Downloads
36
Maintainers
Readme
void-elements
:memo: Object of "void elements" defined by the HTML Standard
Exports an Object
of "void element" node names as defined by the HTML spec.
The list is programatically generated from the latest WHATWG HTML Standard.
:wrench: Usage
1. node.js
const voidElements = require('@achmadk/void-elements');
assert(!voidElements['span'], '<span> is not a void element');
assert(voidElements['img'], '<img> is a void element');
2. vite js (if have error importing void-elements
)
import { defineConfig } from 'vite'
export default defineConfig({
// rest of your vite configuration
resolve: {
alias: [
// another aliases
{
find: 'void-elements',
replacement: '@achmadk/void-elements'
}
]
}
})
License
MIT