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

@animb1996/cds-data-drift

v0.1.0

Published

Read-only CSV and database drift reporting for SAP CAP projects

Readme

CDS Data Drift

@animb1996/cds-data-drift is a read-only seed-data drift reporter for SAP CAP. It compares local db/data CSV records with the database configured as the CAP db service.

Phase one never updates the database and never rewrites a CSV.

The current release targets SAP CAP 9 (@sap/cds >=9 <10) and supports Node.js 20 or newer. CAP 10 is intentionally excluded because it requires Node.js 22 or newer and has not yet been certified with this release.

Reported conditions

  • LOCAL_ONLY: a key exists only in the CSV.
  • DATABASE_ONLY: a key exists only in the database.
  • CHANGED: the key exists in both sources but one or more compared fields differ.
  • DUPLICATE_KEY: a comparison key occurs more than once.
  • Validation errors such as unknown entities, columns, or missing keys.

Install locally

From a consuming CAP project:

npm install --save-dev ../cds-data-drift

After publication:

npm install --save-dev @animb1996/cds-data-drift

Configure

Add cds.dataDrift to the consuming project's package.json:

{
  "cds": {
    "dataDrift": {
      "folders": ["db/data"],
      "dbService": "db",
      "ignoreManagedColumns": true,
      "emptyStringEqualsNull": true,
      "excludeEntities": [
        "flowmate.db.ProcessRequests",
        "flowmate.db.ProcessTasks"
      ],
      "entities": {
        "flowmate.db.ProcessSubTypes": {
          "keys": ["code"]
        },
        "flowmate.ca.db.WorkflowStepConfigs": {
          "keys": ["requestType_code", "requestVariant_code", "stepNo"],
          "ignoreColumns": ["ID"]
        }
      }
    }
  }
}

CDS keys are used automatically when an entity does not have an explicit key configuration.

Run locally

Against the project's configured local database:

npx cds-data-drift

Against a bound SAP HANA Cloud HDI container:

cds bind db --to flowmate-db:data-drift --for ci --kind hana
cds bind --exec --profile ci -- npx cds-data-drift

Compare one entity:

npx cds-data-drift --entity flowmate.db.ProcessSubTypes

Create reports:

npx cds-data-drift --format json --out data-drift.json
npx cds-data-drift --format markdown --out data-drift.md

Use --warn-only during initial CI adoption to report mismatches without returning exit code 1.

Exit codes

| Code | Meaning | |---:|---| | 0 | Synchronized, or --warn-only was used | | 1 | Drift or validation mismatch detected | | 2 | Configuration, connection, or execution failure |

Defaults

  • Managed fields createdAt, createdBy, modifiedAt, and modifiedBy are ignored.
  • Empty CSV values and database null are considered equal.
  • Strings are not trimmed unless trimStrings is enabled.
  • At most 100,000 records are read per entity by default.
  • At most 100 mismatched records per category are printed by default.

Security and scope

The command executes database SELECT queries only. The service binding should still use the minimum privileges necessary. This tool is a deployment drift check, not a substitute for SAP HANA Cloud backup and recovery.