Nice Philanthropist Metalhead
Wondering what’s next for npm?Check out our public roadmap! »


1.0.1-alpha.5 • Public • Published

Introducing xcore

What is xcore

xcore is a Node.js® plugin enabling the use of .NET netstandard libraries with javascript. netstandard is a new specification by Microsoft representing a set of .NET API which can be used across many .NET implementations such as .NET Framework and .NET Core. -

Basically xcore allows any Node.js script to use .NET code. xcore is entirely authored by Raffaele Rialdi - @raffaeler

Please refer to the repo github issues to report bugs, ask questions or suggestions.

Show me the code ...


npm install xcorenode

xcorenode is one of the flavors of xcore. In the future I will publish the Electron variant.

Load and initialize xcore

var xcore = require(__dirname + '\\node_modules\\xcorenode\\xcorenode.node');
var netPath = __dirname + "\\node_modules\\xcorenode\\binw10x64";
// load the dll (initializer is optional), then load the class OrderManager (full qualified name)
xcore.initialize(netPath, "SampleLibrary.dll", "SampleLibrary.Initializer");

Load the .net metadata. This operation is done for just the entry-point class of a graph.

xcore.loadClass("SampleLibrary.OrderSample.    OrderManager, SampleLibrary");

Create an instance of the .NET class

var om = new xcore.OrderManager("raf");

Call methods

console.log(om.Add("Hello, ", "world"));

Walk the graph. Metadata for the Order class is loaded automatically


Asynchronous calls

om.AddAsync(2, 3, function(res){


Subscribing events

var cookie = om.addEventHandler("OrderReady", function(sender, args){
    console.log("sender: " + sender.SelectedOrderName, " args:" + args.Name);

Unsubcscribe events

om.removeEventHandler("OrderReady", cookie);

Much more is supported!

Please refer to the github repo for more info.


npm i xcorenode

DownloadsWeekly Downloads






Last publish


  • avatar