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.2.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 from anywhere inside a WinCC OA project:

cd <project>
npx @wincc-oa/create-backend-service my-service

If you omit the service name, you will be prompted to enter one:

npx @wincc-oa/create-backend-service
# Enter service name: my-service

This creates the service at <project>/javascript/webserver-js/services/my-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 | | --skip-install | Skip running npm install after scaffolding |

If service-name is omitted, you will be prompted to enter one interactively.

Important: run in the main project

This tool must be run from within a WinCC OA project that contains a config/config file, because it reads that file to locate the WinCC OA installation path. It will not work when run inside a sub-project, since sub-projects do not have their own config/config.

If you need the service in a sub-project, run the scaffolding in the main project first and move the created directory to the sub-project afterwards.

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

The scaffolder automatically detects your WinCC OA installation, configures the webserver-js TypeScript path in tsconfig.json, and runs npm install (use --skip-install to skip this step in restricted environments). After that:

1. Build

cd <project>/javascript/webserver-js/services/<service-name>
npm run build

Or start a watcher for automatic re-compilation:

npm run watch

2. 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

Before the first service has been created, the directory <project>/javascript/webserver-js/services/ usually does not exist yet, and webserver.js cannot watch this directory. Therefore, the first service will not be detected automatically until webserver.js is restarted.

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.

Requirements

  • Node.js >= 20
  • Must be run from within a WinCC OA project directory tree (a directory that has a config/config file in its ancestry)
  • The WinCC OA installation must have the Node.js addon installed (provides winccoa-manager and @types/winccoa-manager)