Nyora (JavaScript) - v0.1.1
    Preparing search index...

    Class ParserRuntime

    Run Nyora's bundled JavaScript parsers inside an embedded jsdom window.

    A single instance owns one jsdom window with the evaluated NyoraParsers global. Parser calls are dispatched through a tolerant ParserContext that proxies HTTP to Node's native fetch and HTML parsing to jsdom.

    const rt = new ParserRuntime();
    const sources = rt.sources();
    const popular = await rt.call("MANGADEX", "popular", { page: 1 });
    rt.close();
    Index

    Constructors

    Methods

    Constructors

    Methods

    • Rebuild the jsdom context from the (possibly updated) bundle.

      Re-reads the parser bundle via the OtaManager and recreates the jsdom window from scratch. Call this after an OTA update so the new parsers take effect.

      Returns void

    • Release the jsdom window. Safe to call more than once.

      Returns void

    • Return the catalog of available sources as raw parser metadata objects.

      Returns Record<string, unknown>[]

      The descriptors exactly as emitted by NyoraParsers.getAllSources() (camelCase keys), or an empty array if the bundle returns something other than an array.

    • Invoke one parser method and return its decoded result.

      Parameters

      • sourceId: string

        The source identifier, with or without the parser: prefix.

      • method: ParserMethod

        One of popular, latest, search, details, or pages.

      • args: CallArgs = {}

        Method arguments (e.g. page, query, url, manga, branch, filter) passed through to the parser.

      Returns Promise<unknown>

      The parser result as native JS objects.

      ParserRuntimeError If the parser is missing, the method is unknown, or the parser/engine fails.