Metreeca MIME
    Preparing search index...

    Module @metreeca/mime-xml - v0.1.0

    XML and HTML processing tasks.

    Parses XML and HTML documents into a shared tree shape, selects nodes by XPath expression, extracts the main content of web pages, renders it as Markdown, and reads selected values as the expected primitive types.

    @metreeca/mime-xml

    npm

    XML and HTML processing tasks for @metreeca/mime.

    Installation

    npm install @metreeca/gear      # the job executor
    npm install @metreeca/mime-xml # this package
    Important

    Node.js 22 or later is required.

    Warning

    TypeScript consumers must use "moduleResolution": "nodenext"/"node16"/"bundler" in tsconfig.json. The legacy "node" resolver is not supported.

    Usage

    Task Description
    xml() XML parser
    html() HTML parser
    xpath() XPath selector
    focus() Content extractor
    untag() Markdown renderer

    Support

    • open an issue to report a problem or to suggest a new feature
    • start a discussion to ask a how-to question or to share an idea

    License

    This project is licensed under the Apache 2.0 License – see LICENSE file for details.

    Target

    A value an expression is evaluated against or returns.

    Attribute

    An attribute of an element, as a node.

    XPath

    XPath selector over parsed X/HTML trees.

    focus

    Creates a content extractor.

    html

    Creates an HTML parser.

    untag

    Creates a Markdown renderer.

    xml

    Creates an XML parser.

    xpath

    Creates an XPath selector.

    boolean

    Reads a selected value as a boolean.

    number

    Reads a selected value as a number.

    string

    Reads a selected value as text.

    Reads a selected value as a link.