{"library":"webidl2","type":"library","category":null,"description":"webidl2.js is the official W3C-maintained parser for Web IDL (Interface Definition Language), which is used to specify web APIs in an interoperable manner. The library provides core functionalities to `parse` Web IDL strings into a structured Abstract Syntax Tree (AST), `write` an AST back into a Web IDL string, and `validate` the semantic correctness of an AST. This enables programmatic analysis, modification, and generation of Web IDL definitions. It supports both Node.js (requiring Node.js 18 or higher) and browser environments, with distinct usage patterns for each. The current stable version is 24.5.0, reflecting a mature and specification-compliant implementation. Its key differentiators include direct W3C backing, comprehensive support for the Web IDL specification, and tools for both parsing and re-serializing IDL, making it an authoritative choice for developers working with Web IDL definitions.","language":"javascript","status":"active","version":"24.5.0","tags":["javascript"],"last_verified":"Wed May 27","install":[{"cmd":"npm install webidl2","imports":["import { parse } from 'webidl2';","const { write } = require('webidl2');","const tree = WebIDL2.parse('interface Foo {}');","import { validate } from 'webidl2';"]},{"cmd":"yarn add webidl2","imports":[]},{"cmd":"pnpm add webidl2","imports":[]}],"homepage":"https://www.w3.org/TR/webidl/","github":"https://github.com/w3c/webidl2.js","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/webidl2","openapi_spec":null,"status_page":null,"smithery":null,"compatibility":{"summary":{"python_range":"18–22","success_rate":0,"avg_install_s":null,"avg_import_s":null,"wheel_type":null},"url":"https://checklist.day/v1/registry/webidl2/compatibility"}}