Frage

I'm struggling to get node's util functions to output anything from within a spookyJS callback:

var utils = require('utils');
...spooky code...
spooky.on('remote.message', function(msg) {
    utils.log('message'); // does nothing
    this.utils.log('message'); // does nothing
}

Is it possible to access the util functions within a callback like this?

War es hilfreich?

Lösung

The problem may be that you are trying to require utils instead of util.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top