Socket
Socket
Sign inDemoInstall

@sap/cds-compiler

Package Overview
Dependencies
6
Maintainers
3
Versions
99
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sap/cds-compiler


Version published
Maintainers
3
Install size
4.45 MB
Created

Package description

What is @sap/cds-compiler?

@sap/cds-compiler is a package designed to compile and process Core Data Services (CDS) models. It is part of the SAP Cloud Application Programming Model (CAP) and provides functionalities to parse, compile, and transform CDS models into various formats.

What are @sap/cds-compiler's main functionalities?

Parsing CDS Models

This feature allows you to parse CDS source code into a Core Schema Notation (CSN) model. The code sample demonstrates how to parse a simple CDS model defining an entity 'Books' with a 'title' property.

const cds = require('@sap/cds-compiler');
const source = 'entity Books { title: String; }';
const csn = cds.parse(source);
console.log(JSON.stringify(csn, null, 2));

Compiling CDS Models

This feature allows you to compile CDS source code into a CSN model. The code sample shows how to compile a CDS model into its CSN representation.

const cds = require('@sap/cds-compiler');
const source = 'entity Books { title: String; }';
const csn = cds.compile.to.csn(source);
console.log(JSON.stringify(csn, null, 2));

Transforming CDS Models

This feature allows you to transform CDS models into different formats, such as EDM (Entity Data Model). The code sample demonstrates transforming a CSN model into an EDM format.

const cds = require('@sap/cds-compiler');
const source = 'entity Books { title: String; }';
const csn = cds.compile.to.csn(source);
const edm = cds.compile.to.edm(csn);
console.log(JSON.stringify(edm, null, 2));

Other packages similar to @sap/cds-compiler

Readme

Source

Getting started

Table of Contents

Installation and Usage
Documentation
Fiori annotations

Installation and Usage

github

Do not add direct dependency to cdsv's github project!

Snapshots

Unfortunately npm does not support snapshots via nexus. The only possibility is to download manually a snapshot and install it.

Milestones/Releases

Configure Nexus milestones registry:

npm config set registry "http://nexus.wdf.sap.corp:8081/nexus/content/groups/build.milestones.npm"

or releases registry:

npm config set registry "http://nexus.wdf.sap.corp:8081/nexus/content/groups/build.releases.npm"

Install via npm:

npm install "@sap/cds-compiler"

Or maintain your package.json dependencies as follows:

package.json

  "dependencies": {
    "@sap/cds-compiler": "*"
  }

Command Invocation

The compiler with its options is invoked like any other npm/Unix command:

cdsc [options] <file...>

See cdsc --help for the options.

The exit code is similar to grep and other commands:

  • 0: successful compilation
  • 1: compiled with error (the command invocation itself is ok)
  • 2: commmand invocation error (invalid options, repeated file name)

Documentation

See https://github.wdf.sap.corp/pages/cap/CDS.

Keywords

FAQs

Last updated on 12 Jun 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc