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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@k8pai/xml-to-postman

v1.0.5

Published

a simple package to parse xml files to a postman collection.

Readme

XML to Postman CLI (xpc)

A CLI tool to convert XML interface schema files into an importable Postman collection. It supports configuration via a xpc.config.js file (or a custom config path via CLI options).


📦 Installation

npm i -g @k8pai/xml-to-postman

Or use it locally in a project:

npm i @k8pai/xml-to-postman

🚀 Usage

Run the CLI in a project with a config file:

xpc

By default, the tool looks for a config file named xpc.config.js in the current working directory. This can be overridden using CLI options.


⚙️ CLI Options

| Option | Alias | Description | Example | | ---------------------- | ----- | ------------------------------------------------------------------- | --------------------------------------------- | | -c, --config <path> | | Specify config file path (overrides xpc.config.js). | xpc -c ./configs/xpc.config.js | | -o, --outfile <path> | | Specify output file path for the generated Postman collection JSON. | xpc -o ./collections/inventory.postman.json | | -h, --help | | Show help information. | xpc --help |


Sample Config (xpc.config.js)

/** @type {import('@k8pai/xml-to-postman').XpgConfigurationType} */
export const xpcConfig = {
  name: "Testing",
  version: "2.0",
  modules: [
    {
      prefix: "",
      name: "patients",
      baseUrl: "patientsurl",
      directory: "./idl/patients",
    },
    {
      prefix: "",
      name: "doctors",
      baseUrl: "doctorsurl",
      directory: "./idl/doctors",
    },
    {
      prefix: "",
      name: "authentication",
      baseUrl: "authenticationurl",
      directory: "./idl/auth",
    },
  ],
  variables: {
    patientsurl: "http://localhost:9982/patients",
    doctorsurl: "http://localhost:9982/doctors",
    authenticationurl: "http://localhost:9982/authentication",
  },
};

export default xpcConfig;

📌 How It Works

  • The CLI reads all XML schema files from the directories defined in modules.
  • Each <ns:interface> and <method> in XML is converted into a Postman request.
  • Generated requests are grouped under Postman folders by module name or prefix.
  • Variables from variables are injected into the Postman collection for easy environment management.
  • The final JSON is saved as a Postman collection (default: collection.json).
  • A reference to the sample XML schema file can be found here

📝 Example Command

xpc -c ./configs/xpc.config.js -o ./collections/inventory.postman.json

✅ This will:

  • Use ./configs/xpc.config.js as the configuration file.
  • Generate a Postman collection file named inventory.postman.json in ./collections.

You can now import that JSON file directly into Postman. 🎉


⚡ Features

  • Parses multiple XML schema files in a folder.

  • Supports CRUD operations (fetch, add, modify, delete, undelete, list).

  • Generates a valid Postman Collection v2.1 JSON.

  • Maps:

    • http_method → Postman request method.
    • query_param → Query params in request.
    • input → Request body placeholder.
    • output → Response placeholder.

📖 Notes

  • Default config file is xpc.config.js if no --config is provided.
  • version must be either 2.0 or 2.1 (Postman collection schema versions).
  • Query parameters, inputs, and outputs from XML are mapped into Postman requests automatically.
  • Use the variables section in config to define Postman variables (e.g., {{baseurl}}).