umutm
umutm

Reputation: 2894

Using ActiveX Com Components with nodejs. Is it possible

Is there a way to use any ActiveX com components with nodejs?

Actually, I would never need this but I'm running nodejs on Windows and trying to send ping requests without forking new processes (no such module exists for Windows).

As some Activex components exist for sending ping requests with raw sockets, maybe I can use them.


An example of how you can create a COM object from JavaScript is:

var rs = new ActiveXObject("ADODB.Recordset");

Upvotes: 6

Views: 11914

Answers (4)

CarpeDiemKopi
CarpeDiemKopi

Reputation: 334

Years later:

node winax

node win32ole no longer works with up to date node.js versions

Upvotes: 1

idobatter
idobatter

Reputation: 81

There is node-win32ole ( npm install win32ole ).

EDIT: win32ole is no longer actively maintained. You could try winax instead.

Upvotes: 8

Stephen Vickers
Stephen Vickers

Reputation: 29

An ICMP ping module for Node.js now exists:

https://npmjs.org/package/net-ping

Upvotes: 1

laktak
laktak

Reputation: 60093

(updated)

You could try to use node-ffi to bind to Win32 and launch a COM/ActiveX component (CoCreateInstance) or access winsock/icmp directly. See https://github.com/rbranson/node-ffi

Or try to ping via WMI, e.g. "select * from win32_pingstatus where Address='...'". See https://npmjs.org/package/wmi

Upvotes: 1

Related Questions