@achmadk/void-elements
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

void-elements

📝 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.

npm version

🔧 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

Package Sidebar

Install

npm i @achmadk/void-elements

Weekly Downloads

5

Version

1.0.0

License

MIT

Unpacked Size

4 kB

Total Files

6

Last publish

Collaborators

  • achmadkurnianto