npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@adrk/mxls

v1.0.7

Published

Monaco XML Language Support — schema-driven autocomplete, validation, and template generation

Readme

mxls — Monaco XML Language Support

Schema-driven autocomplete, real-time validation, template generation, and code formatting for the Monaco editor. Framework-agnostic — works with Angular, React, Vue, or vanilla JS.


Features

| Feature | Description | |---|---| | Element completion | Suggests child elements based on the XML schema for the current parent tag | | Attribute completion | Suggests valid attributes for any open tag | | Attribute value completion | Suggests enum values when the cursor is inside attr="..." | | Closing tag completion | Suggests </Tag> for the nearest unclosed element | | maxOccurs enforcement | Hides elements from suggestions once they reach their schema-defined occurrence limit | | Context-aware completion | Resolves the correct element type when the same element name appears with different types in different parent contexts | | Cross-schema type resolution | Resolves enum values defined in a different schema file than the element | | Real-time validation | Underlines unknown elements, missing required attributes, wrong attribute values, and occurrence violations | | Hover messages | Explains each validation error on hover | | Template generation | Generates an XML skeleton from the schema up to a configurable nesting depth | | Code formatting | Reformats XML via Prettier | | Dynamic namespace schemas | Fetches and registers schemas for xmlns:prefix="uri" declarations at runtime |


Installation

npm install mxls monaco-editor @xmldom/xmldom ts-debounce prettier

Add squiggle styles (or @import 'mxls/style.css'):

.xml-lint { border-width: 0; border-style: dotted; border-bottom-width: 3px; }
.xml-lint--fatal-error { border-color: red; }
.xml-lint--error       { border-color: orange; }
.xml-lint--warning     { border-color: blue; }

Quick Start

import { SchemaRegistry, EditorPlugin } from 'mxls'
import type { IMonacoApi } from 'mxls'

function initEditor(editor: monaco.editor.IStandaloneCodeEditor, monacoApi: IMonacoApi): void {
    const registry = new SchemaRegistry(monacoApi)

    registry.set({
        path: 'my-schema.xsd',
        value: MY_SCHEMA_STRING,
        alwaysInclude: true,
    })

    const plugin = new EditorPlugin(monacoApi, editor, registry)
    plugin.activate()
}

Angular:

onEditorInit(editor: any): void {
    initEditor(editor, (window as any).monaco)
}

React:

<Editor language="xml" onMount={(editor, monaco) => initEditor(editor, monaco)} />

Keyboard Shortcuts

| Action | Shortcut | |---|---| | Autocomplete | Ctrl+Space | | Reformat code | Ctrl+Shift+F | | Generate template | Ctrl+Shift+G |

All actions also appear in the right-click context menu.


Validation Errors

  • Unknown element — tag not defined in the schema for its parent
  • Missing required attributeuse="required" attribute absent
  • Unknown attribute — attribute not declared in the schema
  • Invalid boolean — xs:boolean attribute with value outside {true, false, 1, 0}
  • Invalid enum value — value not in xs:enumeration list
  • maxOccurs exceeded — child element appears too many times
  • minOccurs violated — required child element missing
  • Empty choice — xs:choice element has no children

Dependencies

| Package | Role | |---|---| | monaco-editor | TypeScript types only | | @xmldom/xmldom | XML/XSD DOM parsing | | ts-debounce | Debounces validation on keydown | | prettier + prettier/plugins/html | XML reformatting | | turndown | HTML → Markdown for documentation hovers |