Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@darabonba/csharp-generator

Package Overview
Dependencies
Maintainers
4
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@darabonba/csharp-generator

The darabonba generator for CSharp

latest
Source
npmnpm
Version
2.0.1
Version published
Maintainers
4
Created
Source

English | 简体中文

Darabonba Code Generator for CSharp

Node.js CI codecov NPM version npm download

Installation

Darabonba Code Generator was designed to work in Node.js. The preferred way to install the Generator is to use the NPM package manager. Simply type the following into a terminal window:

npm install @darabonba/csharp-generator

Usage

'use strict';
const path = require('path');
const fs = require('fs');

const Parser = require('@darabonba/parser');
const CSGenerator = require('@darabonba/csharp-generator');

const sourceDir = "<Darabonda package directory>";
const outputDir = "<Generate output directory>";

// generate ast data by Parser
let packageMetaFilePath = path.join(sourceDir, 'Darafile');
let packageMeta = JSON.parse(fs.readFileSync(packageMetaFilePath, 'utf8'));
let mainFile = path.join(sourceDir, packageMeta.main);
let ast = Parser.parse(fs.readFileSync(mainFile, 'utf8'), mainFile);

// initialize generator
let generatorConfig = {
  ...packageMeta,
  pkgDir: sourceDir,
  outputDir
};

let generator = new CSGenerator(generatorConfig);

// generate csharp code by generator
generator.visit(ast);

// The execution result will be output in the 'outputDir'

Issues

Opening an Issue, Issues not conforming to the guidelines may be closed immediately.

Changelog

Detailed changes for each release are documented in the release notes.

License

Apache-2.0 Copyright (c) 2009-present, Alibaba Cloud All rights reserved.

FAQs

Package last updated on 27 Jun 2025

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