html-element-map

1.3.1 • Public • Published

html-element-map Version Badge

Look up HTML tag names via HTML Element constructors, and vice versa.

github actions coverage dependency status dev dependency status License Downloads

npm badge

Entry points

byTag

const assert = require('assert');
const byTag = require('html-element-map/byTag');
// or: import byTag from 'html-element-map/byTag';
// or: import { byTag } from 'html-element-map';

assert.deepEqual(
		byTag('a'),
		[{
				constructor: window.HTMLAnchorElement,
				constructorName: 'HTMLAnchorElement',
				expectedConstructor: window.HTMLAnchorElement,
				tag: 'a'
		}],
);

byConstructor

const assert = require('assert');
const byConstructor = require('html-element-map/byConstructor');
// or: import byConstructor from 'html-element-map/byConstructor';
// or: import { byConstructor } from 'html-element-map';

assert.deepEqual(
		byConstructor(window.HTMLAnchorElement),
		[{
				constructor: window.HTMLAnchorElement,
				constructorName: 'HTMLAnchorElement',
				expectedConstructor: window.HTMLAnchorElement,
				tag: 'a'
		}],
);

byConstructorName

const assert = require('assert');
const byConstructorName = require('html-element-map/byConstructorName');
// or: import byConstructorName from 'html-element-map/byConstructorName';
// or: import { byConstructorName } from 'html-element-map';

assert.deepEqual(
		byConstructorName('HTMLAnchorElement'),
		[{
				constructor: window.HTMLAnchorElement,
				constructorName: 'HTMLAnchorElement',
				expectedConstructor: window.HTMLAnchorElement,
				tag: 'a'
		}],
);

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.3.1
    1,197,051
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.3.1
    1,197,051
  • 1.3.0
    55,922
  • 1.2.0
    245,427
  • 1.1.0
    35,002
  • 1.0.1
    27,783
  • 1.0.0
    4,457

Package Sidebar

Install

npm i html-element-map

Weekly Downloads

1,565,642

Version

1.3.1

License

MIT

Unpacked Size

29.7 kB

Total Files

24

Last publish

Collaborators

  • ljharb