Reputation: 34627
I'm using a customized version of node-clim, but I want to put away all the customization code in a module of its own and require()
it in my main app. But I can't seem to do that..
This code works
var util = require('util');
var clim = require('clim')
clim.logWrite = function(level, prefixes, msg) {
...
customizing code
...
process.stderr.write(...);
};
var console = clim();
console.log('hey'); // works
But in trying to put the above in a separate file clim.js
and exporting the console object...
module.export = console;
and require()
ing it in my main app doesn't work..
var console = require('./clim');
console.log('hey');
// ^ TypeError: Object #<Object> has no method 'log'
What am I doing wrong?
Upvotes: 0
Views: 2967
Reputation: 382150
Change
module.export = console;
to
module.exports = console;
Upvotes: 3