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

@wincc-oa/create-backend-service

v1.1.0

Published

Scaffold a WinCC OA webserver.js dynamic service

Readme

@wincc-oa/create-backend-service

Scaffolds a new SIMATIC WinCC Open Architecture webserver.js dynamic service with example request handlers and HTTP endpoints.

Dynamic services are loaded by the webserver.js service manager at runtime -- no rebuild or restart of the webserver required.

Quick start

Run the scaffolder inside the services/ directory of a WinCC OA (sub-)project that has webserver.js running:

mkdir -p <project>/javascript/webserver-js/services
cd <project>/javascript/webserver-js/services
npx @wincc-oa/create-backend-service my-service

This creates a my-service directory containing a ready-to-build service.

Important: Always use the version of create-backend-service that matches your WinCC OA installation. The correct version can be found in javascript/webserver-js/package.json inside your installation directory. To install a specific version:

npx @wincc-oa/[email protected] my-service

Usage

npx @wincc-oa/create-backend-service <service-name>

| Argument | Description | | ---------------- | ------------------------------------------------------------------- | | <service-name> | Name of the service directory to create (e.g. my-weather-service) | | -h, --help | Show help |

Generated structure

<service-name>/
  src/
    exampleHandler.ts    # WebSocket request handler (ping, type.name, connect/disconnect)
    exampleRoutes.ts     # HTTP endpoint (/status)
  package.json           # Service manifest (webserverjs-service)
  tsconfig.json          # TypeScript configuration
  .gitignore

Setup after scaffolding

1. Configure TypeScript paths

The generated tsconfig.json contains a paths mapping for webserver-js that must be adjusted to point at your WinCC OA installation:

// tsconfig.json
{
  "compilerOptions": {
    "paths": {
      "webserver-js": ["<path-to-installation>/javascript/webserver-js"]
    }
  }
}

Replace <path-to-installation> with the absolute or relative path to your WinCC OA installation directory. This allows TypeScript to resolve the types exported by webserver-js during compilation. At runtime, webserver-js is provided by the webserver process itself -- no npm install needed for it.

2. Build

cd <service-name>
npm run build

Or start a watcher for automatic re-compilation:

npm run watch

3. Verify

Browse to these URLs to check that the service is loaded and responding:

  • https://<host>:<port>/_services — lists all discovered services
  • https://<host>:<port>/<service-name>/status — service health check

Included examples

| File | What it demonstrates | | ------------------- | ------------------------------------------------------------------------------------------------------ | | exampleHandler.ts | Request handler with one-shot (ping, type.name) and subscription (connect/disconnect) commands | | exampleRoutes.ts | HTTP endpoint (/status) with injected Router factory |

How services work

A dynamic service is a directory with a package.json that contains a "webserverjs-service" manifest. The manifest declares:

  • requestHandlers -- WebSocket command handlers (extend WsjRequestHandlerBase)
  • httpEndpoints -- HTTP routes mounted on the Express app
  • acl -- access control rules for the service's endpoints
  • outDir -- directory containing compiled JavaScript (default: dist)

The service imports types and base classes from webserver-js, which is the main webserver package available in every WinCC OA installation. No additional npm dependencies are required for basic services.

License

MIT