A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.npmjs.com/package/@webref/elements below:

@webref/elements - npm

Markup elements of the Web platform and associated Web IDL interfaces

This package contains a list per spec of markup elements that compose the Web platform, scraped from the latest versions of web platform specifications in webref, along with the name of the Web IDL interface that these elements implement. Fixes are applied to ensure that guarantees.

The async listAll() method resolves with an object where the keys are spec shortnames, and the values are the data for that spec. Example:

const elements = require('@webref/elements');

elements.listAll().then(all => {
  for (const [shortname, data] of Object.entries(all)) {
    // do something with the json object
  }
});

For each spec, value is an object with a spec property that describes the specification, and an elements property that lists elements defined in the spec, as an array of objects with name, interface, href, and obsolete properties. The interface property is not present for elements that do not implement an interface:

const elements = require('@webref/elements');

elements.listAll().then(all => {
  for (const [shortname, data] of Object.entries(all)) {
    console.log();
    console.log(data.spec.title);
    for (const el of data.elements) {
      if (el.interface) {
        console.log(`- ${el.name} implements ${el.interface}`);
      }
      else {
        console.log(`- ${el.name} does not implement an interface`);
      }
    }
  }
});

The href property is the URL to the definition of the element in the specification. The property is always set.

The obsolete property is a boolean flag, only present (and set to true) for elements that are obsolete.

The following guarantees are provided by this package:


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4