Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@webref/elements

Package Overview
Dependencies
Maintainers
0
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@webref/elements

Markup elements of the Web platform and associated Web IDL interfaces

  • 2.4.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

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.

API

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.

Guarantees

The following guarantees are provided by this package:

  • All Web IDL interfaces exist in the latest version of the @webref/idl package at the time the @webref/elements package is released.
  • All elements link back to their definition in the spec.

FAQs

Package last updated on 13 Sep 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc