CSharpToJs 0.2.1

dotnet tool install --global CSharpToJs --version 0.2.1                
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest # if you are setting up this repo
dotnet tool install --local CSharpToJs --version 0.2.1                
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=CSharpToJs&version=0.2.1                
nuke :add-package CSharpToJs --version 0.2.1                

C# to JS

Used for converting C# models and DTOs to javascript classes

A global .NET Core tool to easily convert C# models and classes into Javascript classes

C# Input alternate text is missing from this package README image JS output alternate text is missing from this package README image

Installation

Install the tool

dotnet tool install --global CSharpToJs

Update .csproj

Update your project to output all its dependencies by adding <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies> to your .csproj file for the project you're running the tool for. This is so the CSharpToJs tool can resolve any dependencies used, e.g. Nuget packages.

<PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp2.2</TargetFramework>
    <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>

Create a configuration file

Add a csharptojs.config.json. I'd recommend the project's root folder but you can place it wherever you want. By default, the tool will look in the folder in which you're executing the tool in but also accepts a path (excl. filename) to the config file. Note that any relative paths in the config will be relative to where the tool is being executed, not where the config file is.

See Usage for details.

Usage

Simple

Simply execute csharptojs in the command line without any arguments. The csharptojson.config.json will be read from the folder where the tool is being executed.

$ csharptojs

With path to config

The first, and only, argument is the path to the config file, without the filename. E.g. c:/config/a-folder/csharptojson.config.json would be:

$ csharptojs c:/config/a-folder

Configuration file

Docs in progress. See example in Samples or definition file

Release History

  • 0.2.1

    • [JsIgnore] attribute added
  • 0.1.0

    • First initial release

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.2 is compatible.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last updated
0.2.1 851 7/16/2019
0.1.0 553 7/14/2019