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-js-mockdata

A cds add command that generates CSV seed files into db/data from @Mockdata annotations on your entities, filling each column with values from the Faker module the annotation names.

Turns an empty model into a demonstrable one. cds add mockdata writes a CSV per entity into db/data, with values driven by Faker modules named in the annotation — so names look like names and IBANs like IBANs, rather than every row reading str1.

Facts

Latestv0.0.3ReleasedLast pushLicenceMIT

Where it sits

Lives in
Provides
Seed dataCAPSeed datacapabilityGetting realistic data into a service so it can be developed and demonstrated — initial data, per-tenant content, and believable volumes for testing.
Flavors
Node.jsJavafrom its runtime
Requires
@sap/cds≥ 7@sap/cdsartifactThe peer range, as published.

Who is behind it

Mauricio LaufferMauricio LaufferPersonMaintains this
In the atlas: maintains 16, contributes to 41, wrote 4
@mauriciolauffer
maintainer

Before choosing this

Signals

ActivityQuietRelease and repository quiet for 27 months

Both observable publication channels have been quiet for at least 24 full months. This may be normal for stable software; check whether its current state still fits your use.

Conditions

PracticalFunctional boundary

Not a test-data factory. It writes files at build time to seed a database, so it does not build fixtures inside a unit test. The declared peer range stops at cds 7 — nothing says it fails on 9, but nothing says it was tried either.

What it declares

Every artifact

Type
Generator
Origin
Independently maintained
Runtime
build timeNode.js

As a generator

Declared for
>=7
Generates
does not say
Run with
cds add
Distributed through
npm

Connections2

Install

npm add cap-js-mockdata

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

README

quoted from mauriciolauffer/cap-js-mockdata under MIT, read
mauriciolauffer/cap-js-mockdata/README.mdOn GitHub

SAP CAP Mockdata Plugin

npm test

A SAP CAP plugin to generate CSV files populated with mock data for testing.

This plugin uses Faker to generate meaningful mock data both automatically and through annotations.

Setup

All you need to do is to install the plugin and add the @Mockdata annotations to your entities.

Installation

Install the plugin as an npm module:

npm i -D cap-js-mockdata
Annotation

The annotation tag is @Mockdata. You can add and combine all valid Faker module APIs.

// db/schema.cds

entity Customers : cuid, managed {
  name       String  @Mockdata: {person: 'fullName'};
  sex        String  @Mockdata: {person: 'sex'};
  creditCard String  @Mockdata: {finance: 'creditCardNumber'};
  phone      String  @Mockdata: {phone: 'number'};
  ipAddress  String  @Mockdata: {internet: 'ipv4'};
  email      String  @Mockdata: {internet: 'email'};
  street     String  @Mockdata: {location: 'streetAddress'};
  country    String  @Mockdata: {location: 'countryCode'};
};
Using

Once you have installed the plugin and added the annotations, or not, you can execute the following command in a terminal:

cds add mockdata

The cds add mockdata command will create CSV files for every supported CDS Entity. The CSV files will be created into the db/data folder, the filenames will be something like namespace-entityName.csv and their content will look like:

IDcreatedAtcreatedBymodifiedAtmodifiedBynamesexcreditCardphoneipAddressemailstreetcountry
bef3c7b8-1232-4860-bded-efd51443e508Sun Oct 06 2024 15:55:24 GMT-0300 (Brasilia Standard Time)Julius_Hintz48Sun Nov 03 2024 14:38:56 GMT-0300 (Brasilia Standard Time)Brain_MosciskiEdgar Langoshfemale3564-4519-0923-7387801.226.6645 x01258214.155.102.159Marcellus.Fritsch@hotmail.com640 Bramley CloseAustria
96ac7211-691a-4c2a-8fc0-0ae509693193Thu Mar 28 2024 20:32:35 GMT-0300 (Brasilia Standard Time)Clotilde_DAmoreThu Nov 23 2023 10:49:44 GMT-0300 (Brasilia Standard Time)Brendan.Corwin-SchinnerErica McDermottmale6567-6280-8822-5389-0611(240) 938-122337.230.118.100Shayne78@gmail.com1803 Feeney ParkCocos (Keeling) Islands
4fc525bc-e22b-4c55-a447-0e4c9fef1ffdFri Feb 09 2024 15:21:45 GMT-0300 (Brasilia Standard Time)Lance78Fri Feb 14 2025 05:25:29 GMT-0300 (Brasilia Standard Time)Donny_BlandaJoseph Lehnermale4686210527760312-939-710914.207.231.127Daija_Oberbrunner94@gmail.com79422 Collin DividePortugal
872b47a8-0bb1-47af-bc02-ef7290cff633Sat Feb 22 2025 01:34:16 GMT-0300 (Brasilia Standard Time)Mateo22Sun Sep 15 2024 18:42:41 GMT-0300 (Brasilia Standard Time)Myrtle52Leigh Wintheiser Imale6759-2563-9161-5976553.277.9724 x23110.88.166.234Elyssa.Adams79@gmail.com139 Park DriveMacao
MIT, read

History

Latest

v0.0.3

Fixes 1

Notes
Bug Fixes
  1. v0.0.2

    Fixes 1

    Notes
    Bug Fixes
53downloads per week, npm
Weekly downloads for cap-js-mockdata26 complete calendar weeks from 2026-04-27 to 2026-10-25; the latest total is 53.27 Apr – 3 May: 1834 May – 10 May: 25311 May – 17 May: 34018 May – 24 May: 27025 May – 31 May: 2621 Jun – 7 Jun: 998 Jun – 14 Jun: 12415 Jun – 21 Jun: 12522 Jun – 28 Jun: 25429 Jun – 5 Jul: 4486 Jul – 12 Jul: 28513 Jul – 19 Jul: 21620 Jul – 26 Jul: 28627 Jul – 2 Aug: 1473 Aug – 9 Aug: 19410 Aug – 16 Aug: 21417 Aug – 23 Aug: 14024 Aug – 30 Aug: 24331 Aug – 6 Sept: 1947 Sept – 13 Sept: 10414 Sept – 20 Sept: 7621 Sept – 27 Sept: 14928 Sept – 4 Oct: 1435 Oct – 11 Oct: 19412 Oct – 18 Oct: 7219 Oct – 25 Oct: 53
Declared alternative
  1. cap-mock-generatorFills db/data with relationally consistent CSV from a .cds schema
Seed data
  1. @animb1996/cds-data-driftCompares a CAP project's CSV data with its database rows
  2. @sap/cds-common-contentISO content for CAP's countries, languages, currencies and timezones
  3. @sap/cdsCAP Node.js runtime
  4. cap-mock-generatorFills db/data with relationally consistent CSV from a .cds schema

Details

Sources5
npm registrydiscovered herechecked
The discovery passdiscovered herechecked
npm registry, cap-js-mockdataversion, releases, installschecked
github.com/git+https://github.com/mauriciolauffer/cap-js-mockdata.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, node
declared for>=7
latestv0.0.3
first release
releases and cadence2
discovered vianpm registry, The discovery pass
first seen in the atlas
ecosystem and domaincap, developer-experience
History in the atlas4
  1. Verdict rings retired. What the ring compressed now lives in readings derived from facts (liveness, compatibility, reach) and in the description fields, so a thing can be dead as a dependency and still worth reading. VISION §9.
  2. Placement put it on testing because the README says 'for testing'. Reading what it does moved it: cds add mockdata writes CSV into db/data, which is the seed-data capability — and precisely where that capability already said the core stops. It seeds a database; it does not build fixtures in a test.
  3. Narrower than it was: the core has generated seed volumes with `cds add data` since mid-2024, so what is left here is per-element realism via Faker annotations. Still the only thing offering that. Dormant two years matters less for a build-time generator whose output is CSV you keep — the real caution is the peer range, which predates cds 9.
  4. First seen.
For your agent
Ref
artifact:mauriciolauffer-cap-js-mockdata
JSON
/artifacts/mauriciolauffer-cap-js-mockdata.json
MCP
Connecting an agent