YantraJS (Machine in Sanskrit)

Please visit GitHub repo at YantraJS

YantraJS

Yantra (Machine in Sanskrit) is a Managed JavaScript Engine for .NET Standard written completely in C#.

NuGet

Name Package
YantraJS (With CSX Module Support) NuGet
YantraJS.Core (Compiler) NuGet
YantraJS.ExpressionCompiler (IL Compiler) NuGet
WebAtoms.YantraJS NuGet

Features

  1. Compiles JavaScript to .Net Assembly
  2. Strict Mode Only JavaScript*
  3. Arrow functions
  4. Classes
  5. Enhanced object literals
  6. Template strings and tagged templates
  7. Destructuring
  8. let const
  9. Map, Set, WeakMap, WeakSet
  10. Symbols
  11. Subclassable built-ins
  12. Binary and Octal literals
  13. Module support
  14. Null coalesce
  15. Optional property chain identifier?.[], identifier?.(, identifier?.identifier
  16. Rest, Default and Spread Parameters
  17. Generators, iterators, for..of
  18. Async/Await
  19. Optional parameters
  20. Many ES5 + ES6 features
  21. CommonJS Module Support
  22. Easily marshal CLR Object to JavaScript and other way around
  23. CSX Module support

* Most JavaScript today is available in strict mode, we do not feel any need to support non strict mode as modules are strict by default.

Documentation

  1. Introduction
  2. Expression Compiler
  3. JavaScript Engine

Discussions

We recommend using Github Discussion on this repository for any question regarding this product.

Special Thanks

  1. We are thankful to authors of Jurassic (we have incorporated number parser, promise and some unit tests from Jurassic.) https://github.com/paulbartrum/jurassic
  2. We are thankful to authors of EsprimaDotNet, we initially built prototype over EsprimaDotNet, but we chose to build our parser/scanner from scratch to support token spans. https://github.com/sebastienros/esprima-dotnet
  3. We are thankful to author of ILPack (we have incorporated saving IL to Assembly from this library.) https://github.com/Lokad/ILPack

Support YantraJS

patreon.com/yantrajs

Sponsor - Web Atoms (React Native alike) for Xamarin Forms

This project is supported by Web Atoms, Web Atoms provides JSX+JavaScript bridge for Xamarin Forms which lets you write Xamarin Forms apps in React Native style.