Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
@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 173,888 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
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.