GeneratorGeneratortypeCreates a project, a component or configuration once, when you run it, rather than taking part in every build.See every one →What this type is →independently maintainedindependently maintainedoriginPublished by one person or a small company outside SAP. Says nothing about quality; the readings say that.See every one →

@cap-handler/generator

Interactive generator for CAP event handlers: reads the model through the reflection API, asks which service, target and phase, then writes the handler file and wires the import and registration into the service implementation.

It covers entities, bound and unbound actions and functions, detects TypeScript or JavaScript from the project, and creates a minimal service implementation if none exists. The registration wiring is the part usually forgotten.

Facts

Latestv0.2.0ReleasedLicenceMIT License

Where it sits

Lives in
Provides
GeneratorsCAPGeneratorscapabilityGetting from nothing to a project that runs, and from a project that runs to one that has the piece you just decided you need. Two different moments: the first is a one-time decision about layout, the second recurs for the life of the project.
Flavors
Node.jsJavafrom its runtime
Requires
@sap/cds≥ 8@sap/cdsartifactThe peer range, as published.

Who is behind it

schmitt-p

What it declares

Every artifact

Type
Generator
Origin
Independently maintained
Runtime
build time

As a generator

Declared for
>=8
Generates
Code or test data
Run with
cds addIts own command
Distributed through
npm

Connections1

@cap-handler/generator connections@cap-handler/generatorPROVIDES→ provides1provides authoredGenerators

Install

npm add @cap-handler/generator

Derived from the package name. No recipe recorded; the README has the configuration.

README

quoted from @cap-handler/generator@0.2.0, read
@cap-handler/generator@0.2.0/README.mdOn npm

@cap-handler/generator

Interactive generator for SAP CAP event handlers. It reads the CDS model via the reflection API, lets you pick a target (entity, bound/unbound action or function), creates the handler files and wires up the imports + registrations in the service implementation. If the implementation is missing, it's scaffolded — preferably via the real cds add handler (from @sap/cds-dk), falling back to a minimal built-in skeleton if that's unavailable.

  • CRUD events, Fiori draft events (NEW, EDIT, PATCH, SAVE, DISCARD) and bound/unbound actions & functions
  • JavaScript (CommonJS or ESM) and TypeScript with typed handlers via cds-typer
  • Works for both the "old" (CAP ≤ 9, CommonJS) and the "new" (CAP 10, ESM) project layout — see CAP version compatibility
excerpt, MIT License, read licencethe rest, on npm

History

Latest

v0.2.0

  1. v0.1.1

  2. v0.1.0

On npm
7downloads per week, npm
Weekly downloads for @cap-handler/generator26 complete calendar weeks from 2026-04-20 to 2026-10-18; the latest total is 7.20 Apr – 26 Apr: 027 Apr – 3 May: 04 May – 10 May: 011 May – 17 May: 018 May – 24 May: 025 May – 31 May: 01 Jun – 7 Jun: 08 Jun – 14 Jun: 015 Jun – 21 Jun: 022 Jun – 28 Jun: 029 Jun – 5 Jul: 06 Jul – 12 Jul: 013 Jul – 19 Jul: 020 Jul – 26 Jul: 027 Jul – 2 Aug: 2303 Aug – 9 Aug: 5310 Aug – 16 Aug: 2717 Aug – 23 Aug: 1024 Aug – 30 Aug: 1531 Aug – 6 Sept: 187 Sept – 13 Sept: 314 Sept – 20 Sept: 3721 Sept – 27 Sept: 928 Sept – 4 Oct: 1875 Oct – 11 Oct: 2612 Oct – 18 Oct: 7
Generators
  1. SAP Build CodeDevelopment environment on BTP for UI5, Fiori, mobile and CAP
  2. com.sap.cds:cds-maven-pluginMaven plugin running CDS build steps in a CAP Java project
  3. com.sap.cds:cds-services-archetypeMaven archetype generating a new CAP Java project
  4. @khalidmh/capxInteractive project installer for CAP Node.js
  5. Joule in SAP Build CodeJoule's generative AI inside SAP Build Code
  6. @sap/cds-dkCommand line client and development toolkit for CAP
  7. @sap/generator-cap-projectCAP project generator behind SAP Business Application Studio's wizard
  8. @sap/generator-cdsCDS project generator, deprecated in favour of @sap/cds-dk
  9. @sap-ux/cap-config-writerWriter module for changing a CAP project's configuration from code
  10. @sap-ux/createCommand line for changing features of an existing Fiori project
  11. @sap-ux/fe-fpm-writerWriter of flexible programming model elements into Fiori elements apps
  12. @sap-ux/fiori-generator-sharedShared functions and types of the Fiori generators
  13. @sap-ux/odata-service-writerWriter that adds an OData service to an existing UI5 project

Details

Sources4
npm registrydiscovered here, keywords:cdschecked
npm registry, @cap-handler/generatorversion, releases, installschecked
github.com/git+https://gitlab.com/schmitt-p/cap-handler-generator.gittree, pushes, contributors, CIchecked
README.mdquoted, and what the entry declareschecked

Sources are graph entities: the same page may back several entries, and an unreachable source flags every row that rests on it.

Compatibility and provenance
runtimesbuild-time
declared for>=8
latestv0.2.0
first release
releases and cadence3, ~62d median
discovered vianpm registry · keywords:cds
first seen in the atlas
ecosystem and domaincap, developer-experience
History in the atlas1
  1. First seen.
For your agent
Ref
artifact:cap-handler-generator
JSON
/artifacts/cap-handler-generator.json
MCP
Connecting an agent