
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@sap/cds-compiler
Advanced tools
@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.
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));
Sequelize is a promise-based Node.js ORM for Postgres, MySQL, MariaDB, SQLite, and Microsoft SQL Server. It provides functionalities to define models and interact with databases. While it does not compile CDS models, it offers similar functionalities for defining and working with data models.
Installation and Usage
Documentation
Install with npm:
npm install "@sap/cds-compiler"
Or maintain your package.json dependencies as follows:
"dependencies": {
"@sap/cds-compiler": "latest"
}
Please refer to the official CDS documentation.
In case you find a bug, please report an incident on SAP Support Portal.
This package is provided under the terms of the SAP Developer License Agreement.
FAQs
CDS (Core Data Services) compiler and backends
The npm package @sap/cds-compiler receives a total of 152,160 weekly downloads. As such, @sap/cds-compiler popularity was classified as popular.
We found that @sap/cds-compiler demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.