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

@univa.tech/wsdl2ts

v0.1.12

Published

Generate TypeScript clients and types from WSDL definitions.

Readme

wsdl2ts

This tool generates TypeScript type definitions and SOAP clients from WSDL files. Internally it parses WSDL with fast-xml-parser and constructs/prints TypeScript ASTs using ts-morph.

Installation

npm i @univa.tech/wsdl2ts

Usage

import { generateFromWsdl } from "wsdl2ts"

await generateFromWsdl({
  wsdlPaths: [
    "./path/to/foo.wsdl",
    "./path/to/bar.wsdl",
  ],
  outDir: "./generated",
  esm: true, // defaults to true; set to false to emit CJS-compatible imports without extensions
})
  • wsdlPaths can mix file and directory paths. Directories are scanned recursively.
  • outDir -- The generated files are placed at outDir.
  • esm -- defaults to true; set to false to emit CJS-compatible imports without extensions

Generated Output

  • types/client.ts
    • Declares the shared factory signature once for the entire output:
      import type { Client, IOptions } from "@univa.tech/soap"
      
      export type SoapClientFactory = (
        wsdlFileName: string,
        options?: IOptions,
      ) => Promise<Client>
  • <wsdlFileName>/client.ts
    • Emits a single ServiceClient interface that aggregates every operation across all portType definitions in the WSDL.
    • Each operation produces both callback and Promise-based overloads. Promise variants still resolve to Promise<[result, rawResponse, soapHeader, rawRequest]>.
    • Empty request messages reference the shared Void type and remain required parameters (args: Void).
    • Provides a createClientAsync helper that uses the shared SoapClientFactory to create strongly typed clients:
      export interface ServiceClient extends Client {
        doSomething(args: FooParam, callback: ..., options?: unknown, extraHeaders?: Record<string, unknown>): void
        doSomethingAsync(args: FooParam, options?: unknown, extraHeaders?: Record<string, unknown>): Promise<[result: FooResponse, ...]>
      }
      
      export function createClientAsync(
        factory: SoapClientFactory,
        options?: IOptions,
      ): Promise<ServiceClient> {
        return factory("foo", options) as Promise<ServiceClient>
      }
  • types/
    • TypeScript interface definitions for each message and complex type
    • Message request/response shapes (and the elements/types referenced directly from their parts) are emitted under types/<wsdlFileName>/
    • Shared complex types that are not tied to a specific message remain directly under types/
    • Message bound request/response interfaces reuse the referenced complex type name and are wrapped in a namespace matching the port (e.g. ExamplePort.ExampleRequest)
    • Multi-part message wrappers keep a port-prefixed alias to avoid collisions
    • Empty complex types are replaced with Void, limited to types directly under messages
    • types/index.ts re-exports every file within the directory (per WSDL and for shared types) and includes the shared client.ts barrel
  • <wsdlFileName>/index.ts
    • Re-exports the WSDL specific client.ts and types/index.ts
  • index.ts
    • Re-exports each WSDL namespace (e.g. export * as Sample from './sample/index.js') and the shared types/index.ts / types/client.ts

When processing multiple WSDLs, the generator verifies that types with the same namespace and name share the exact structure. Any differences abort generation and the log states which WSDLs conflicted.