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

@saptools/cf-event-mesh

v0.2.0

Published

Listen and publish messages to SAP Event Mesh from SAP BTP Cloud Foundry

Readme

☁️ @saptools/cf-event-mesh

Listen to or publish messages directly to SAP BTP Event Mesh from your terminal.

Easily interact with AMQP queues or publish REST payloads to queues and topics without needing an external client like Postman or Advanced Event Mesh configurations.

npm version license node install size types

Install • Quick Start • CLI • FAQ


✨ Features

  • 🎧 AMQP Listener — stream live messages from an Event Mesh queue directly into your console
  • 📤 REST Publisher — instantly publish JSON payloads to a queue or a topic
  • 🔐 Auto-Discovery — seamlessly fetches credentials (clientid, clientsecret, tokens) via cf env
  • 🛡️ Safe by Default — listening doesn't acknowledge messages by default, ensuring no data loss while debugging
  • 🧩 Zero Config — just provide the app name bound to enterprise-messaging
  • 🪶 Lightweight — no heavy dependencies, relies on Cloud Foundry CLI

📦 Install

# Global CLI
npm install -g @saptools/cf-event-mesh

# Or as a dependency
npm install @saptools/cf-event-mesh
# pnpm add @saptools/cf-event-mesh
# yarn add @saptools/cf-event-mesh

[!NOTE] Requires Node.js ≥ 20 and the official cf CLI on PATH (v8 recommended).


Updates

Every command first checks npm for a newer @saptools/cf-event-mesh (at most once an hour, one small request with a 2-second timeout) and, when one exists, installs that exact version with the package manager that owns the running binary and re-runs the command you typed on the new version. Both steps are announced on stderr; nothing is printed when the install is already current:

cf-event-mesh: updating 0.2.0 -> 0.3.0 ...
cf-event-mesh: updated to 0.3.0; re-running the command

If the install cannot complete, one stderr line gives the manual command and the command runs on the installed version; that version is not retried for a day. cf-event-mesh self-update forces the check and install now; cf-event-mesh self-update --check only reports.

| Control | Effect | | --- | --- | | SAPTOOLS_AUTO_UPDATE=on\|notify\|off | on (default) installs and re-runs; notify prints the manual command once per version; off never checks. Applies to every @saptools CLI. | | CF_EVENT_MESH_AUTO_UPDATE | same values, this CLI only; wins over the global variable | | SAPTOOLS_UPDATE_INTERVAL_MINUTES | minutes between checks (default 60; 0 checks on every run) | | SAPTOOLS_NPM_REGISTRY | registry to check and install from (default: npm's configured registry, then npmjs) | | SAPTOOLS_UPDATE_DEBUG=1 | explain on stderr why nothing happened |

The updater switches itself off in CI (CI set), under NODE_ENV=test or NO_UPDATE_NOTIFIER, when the binary runs from a source checkout, an npm link or an npx cache, and inside the re-run itself. It never writes to stdout, never asks for input, never uses sudo, and never moves onto a prerelease. Its state lives in ~/.saptools/updates/.

🚀 Quick Start

# 1. Make sure you are logged into Cloud Foundry and targeting a space
cf target -o my-org -s dev

# 2. Listen to a queue (messages are not acknowledged by default)
cf-event-mesh listen my-app-srv "namespace/queue-name"

# 3. Publish a message to a topic
cf-event-mesh publish my-app-srv topic "namespace/topic-name" '{"hello":"world"}'

🧰 CLI

🎧 cf-event-mesh listen

Connects to the Event Mesh queue via AMQP and streams incoming messages to the console.

cf-event-mesh listen <app-name> <queue-name>
cf-event-mesh listen <app-name> <queue-name> --ack

| Flag | Description | | --- | --- | | --ack | Acknowledge (delete) messages from the queue as they are received. Warning: this consumes the message permanently. |

📤 cf-event-mesh publish

Publishes a string payload to a specified queue or topic using the REST HTTP endpoint.

cf-event-mesh publish <app-name> queue <queue-name> '<payload>'
cf-event-mesh publish <app-name> topic <topic-name> '<payload>'

Example:

cf-event-mesh publish orders-srv topic "sap/s4/beh/salesorder/v1/SalesOrder/Created/v1" '{"SalesOrder":"10000001"}'

❓ FAQ

No. This package is specifically built for the default SAP Event Mesh (enterprise-messaging service plan default).

By default, the listen command connects with autoAck: false so that you can debug and monitor messages without stealing them from your actual application consumers. If you want to consume and remove them, pass the --ack flag.

It runs cf curl /v3/apps/<guid>/env to extract the enterprise-messaging service binding credentials, including the AMQP WebSocket URL, REST URL, and OAuth2 Client Credentials.


🛠️ Development

From the monorepo root:

pnpm install
pnpm --filter @saptools/cf-event-mesh build
pnpm --filter @saptools/cf-event-mesh typecheck
pnpm --filter @saptools/cf-event-mesh test:unit

🌐 Related


👨‍💻 Author

dongtran ✨

📄 License

MIT


Made with ❤️ to make your work life easier!