C# to JavaScript compiler

# NuGet Packages

h5 consists of several NuGet packages that provide the compiler, runtime library, and additional functionality.

# Core Packages

# h5

This is the main meta-package that includes the core runtime library required for any h5 application. It contains the implementation of the .NET BCL (Base Class Library) in JavaScript, as well as the compiler attributes ([Script], [Reflectable], etc.).

  • Includes: h5.Core, h5-compiler (as a tool dependency usually, but mainly runtime).
  • Usage: Added by default to all h5 projects.

# h5.Core

Contains the HTML5 type definitions and bindings. This package allows you to interact with the DOM, browser APIs (like window, document, XMLHttpRequest, Canvas, etc.) in a strongly-typed manner.

  • Usage: Essential for web development with h5.

# h5-compiler

The compiler tool itself. While typically installed as a global tool, it can also be referenced as a package for build integration scenarios.

# Extensions & Libraries

# h5.Newtonsoft.Json

A port of the popular Newtonsoft.Json library for h5. It provides robust JSON serialization and deserialization capabilities compatible with the full .NET version.

  • Usage: Recommended for complex JSON handling.

# h5.HttpClient

An implementation of System.Net.Http.HttpClient for the browser, built on top of XMLHttpRequest or fetch. It allows you to make HTTP requests using the familiar .NET API.

  • Usage: Recommended for making API calls.

# h5.Howler

A binding library for Howler.js, a modern audio library for the modern web.

  • Usage: For audio playback and management in web applications and games.

# h5.p2

A binding library for p2.js, a 2D physics engine.

  • Usage: For 2D physics simulations in games.

# h5.WebGL2

A binding library for WebGL 2.0.

  • Usage: For high-performance 3D graphics rendering.

# Tooling

# h5.Template

A dotnet new template pack for creating h5 projects easily.

  • Installation: dotnet new install h5.Template