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

captools

v1.0.1

Published

A set of tools for SAP CAP development

Downloads

26

Readme

CAP Tools

A set of command-line tools to streamline SAP Cloud Application Programming (CAP) development, specifically focused on data seeding, SQL generation, and deployment configuration checks.

Features

  • CSV Validation: Validates that your CSV seed files match your CDS model definitions.
    • Checks filenames against entity names (including namespaces).
    • Checks CSV headers against entity elements (missing keys, extra columns, etc.).
  • SQL Generation: Generates SQL INSERT statements from your CSV seed data.
    • Supports PostgreSQL (HANA support coming soon).
    • Handles proper quoting and NULL values.
  • Deployment Config Check: Validates your project structure for deployment.
    • Checks mta.yaml, ui5.yaml, ui5-deploy.yaml, and manifest.json.
    • Verifies consistency of App IDs and archive names across configuration files.

Installation

You can install this tool globally or as a dev dependency in your project.

Global Installation

npm install -g captools

Local Installation

npm install --save-dev captools

Usage

You can run the tool in interactive mode by simply typing captools (if installed globally) or npx captools (if local).

captools

This will launch a menu where you can select the desired operation.

Command Line Interface

You can also run specific commands directly:

captools [command] [options]

Available Commands

| Command | Description | | --------------------------- | ------------------------------------------------------------------------- | | validatecsv | Validate both CSV filenames and headers against the CDS model. | | validatecsv-filenames | Check if CSV filenames match entity names (e.g., namespace-Entity.csv). | | validatecsv-headers | Check if CSV headers match entity properties defined in CDS. | | generate-inserts-postgres | Generate PostgreSQL INSERT statements from CSV files. | | generate-inserts-hana | Generate SAP HANA INSERT statements (Coming Soon). | | check-deploy-config | Analyze app/ folder and mta.yaml for deployment configuration errors. |

Options

  • --tracelevel <level>: Set the output verbosity.
    • 0: Errors only
    • 1: Errors and Warnings (Default)
    • 2: Verbose (Everything, including success messages)
  • --help: Shows help message.

Examples

Validate all CSVs with verbose output:

captools validatecsv --tracelevel 2

Generate Postgres SQL inserts:

captools generate-inserts-postgres

Check deployment configuration:

captools check-deploy-config

Tool Details

1. CSV Validation

This tool expects your CSV files to be located in db/data, db/csv, or db/src/csv. It loads your CDS model using @sap/cds and compares it against the files found.

  • Filename Rules: Expects filenames to match Namespace-EntityName.csv.
  • Header Rules:
    • Errors: Missing key columns, columns not in schema.
    • Warnings: Missing non-key columns.
    • Ignored: Managed fields (createdAt, modifiedAt, etc.) are ignored.

2. SQL Generation

Converts CSV data into SQL scripts.

  • Input: CSV files in db/data, db/csv, or db/src/csv.
  • Output: Creates a captools-inserts/vX folder with .sql files.
  • Postgres: Handles quoting, NULLs, and boolean values appropriate for Postgres.

3. Deployment Config Check

Scans your app/ directory and mta.yaml to ensure consistency.

  • Verifies sap.app.id in manifest.json.
  • Checks that ui5.yaml and ui5-deploy.yaml use the correct name/archiveName.
  • Validates crossNavigation inbouds in manifest.json.
  • Ensures all apps are correctly defined in mta.yaml (modules and build parameters).

License

MIT