Wednesday, February 3, 2016

writing an executable in javascipt


today I played around with javascript and its possibilities. To execute js in the browser was a quite non-innovative approach. That windows-8/10 apps can be written in js was also not new to me.The missing element to cover all kinds of applications was the desktop application. After 10 seconds of google-ing I found out that this works too. Even better, it works in combination with the .net framework which opens up a lot of possibilities.

The following code snippets show my test case. The resources I used were: and additionally to check for the ability to use WPF components (yes that works too) .

@echo off
del program.exe
"c:\Windows\Microsoft.NET\Framework\v4.0.30319\jsc" "program.js"

import System;
import System.Windows.Forms;
function outputMessageBox(text) {
 MessageBox.Show(text, "output message");
function output(text) {
output('hello world');

I am looking forward to find a use case for it :-)

kind regards,

No comments: