How to use the node-windows.EventLogger function in node-windows

To help you get started, we’ve selected a few node-windows examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github logdna / logdna-agent / test / lib / windows-utilities.js View on Github external
describe('lib:windows-utilities', function() {
    if (os.platform() !== 'win32') {
        return;
    }

    var EventLogger = require('node-windows').EventLogger;
    var log = new EventLogger(provider);

    describe('#streamEventLog()', function() {
        it('streams event logs to a socket', function() {
            this.timeout(100000);
            const MockWebSocket = require('mock-socket').WebSocket;
            const MockServer = require('mock-socket').Server;
            var server = new MockServer('ws://localhost:40002');
            var socket = new MockWebSocket('ws://localhost:40002');
            socket.connected = true;
            var lineBuffer = require('../../lib/linebuffer');
            lineBuffer.setSocket(socket);
            var windowsUtilities = requireUncached('../../lib/windows-utilities');

            return new Promise((resolve) => {
                server.on('message', data => {
                    debug('received message!');

node-windows

Support for Windows services, event logging, UAC, and several helper methods for interacting with the OS.

MIT
Latest version published 2 years ago

Package Health Score

59 / 100
Full package analysis