ElectronCgi.DotNet 0.0.1

Package to enable connection .Net with Node applications through the electron-cgi npm package

There is a newer version of this package available.
See the version list below for details.
Install-Package ElectronCgi.DotNet -Version 0.0.1
dotnet add package ElectronCgi.DotNet --version 0.0.1
<PackageReference Include="ElectronCgi.DotNet" Version="0.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ElectronCgi.DotNet --version 0.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Find More information about ElectronCGI here.
Usage:

In NodeJs/Electron:

const { ConnectionBuilder } = require('electron-cgi');

const connection = new ConnectionBuilder()
        .connectTo('dotnet', 'run', '--project', 'DotNetConsoleProjectWithElectronCgi.DotnetPackage')
        .build();

connection.onDisconnect = () => {
    console.log('Lost connection to the .Net process');
};

connection.send('greeting', 'John', theGreeting => {
    console.log(theGreeting); // will print "Hello John!"
});

connection.close();

And in the .Net Console Application:

using ElectronCgi.DotNet;

//...
static void Main(string[] args)
{
    var connection = new ConnectionBuilder()
                        .WithLogging()
                        .Build();

    // expects a request named "greeting" with a string argument and returns a string
    connection.On<string, string>("greeting", name =>
    {
        return $"Hello {name}!";
    });

    // wait for incoming requests
    connection.Listen();        
}

Find More information about ElectronCGI here.
Usage:

In NodeJs/Electron:

const { ConnectionBuilder } = require('electron-cgi');

const connection = new ConnectionBuilder()
        .connectTo('dotnet', 'run', '--project', 'DotNetConsoleProjectWithElectronCgi.DotnetPackage')
        .build();

connection.onDisconnect = () => {
    console.log('Lost connection to the .Net process');
};

connection.send('greeting', 'John', theGreeting => {
    console.log(theGreeting); // will print "Hello John!"
});

connection.close();

And in the .Net Console Application:

using ElectronCgi.DotNet;

//...
static void Main(string[] args)
{
    var connection = new ConnectionBuilder()
                        .WithLogging()
                        .Build();

    // expects a request named "greeting" with a string argument and returns a string
    connection.On<string, string>("greeting", name =>
    {
        return $"Hello {name}!";
    });

    // wait for incoming requests
    connection.Listen();        
}

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.3 227 6/15/2020
1.0.2 170 5/31/2020
1.0.1 720 3/9/2020
1.0.0 102 3/5/2020
0.0.5 768 11/25/2019
0.0.2 947 3/20/2019
0.0.1 413 2/16/2019
Show less