Created
August 9, 2016 01:27
-
-
Save calvin/f72be59338ccbaefb5f9617d33fe2e3a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* transports.js: Set of all transports Winston knows about | |
* | |
* (C) 2010 Charlie Robbins | |
* MIT LICENCE | |
* | |
*/ | |
var path = require('path'); | |
var libs = { | |
'Console': require('./transports/console'), | |
'File': require('./transports/file'), | |
'Memory': require('./transports/memory'), | |
} | |
// | |
// Setup all transports as lazy-loaded getters. | |
// | |
Object.defineProperties( | |
exports, | |
['Console', 'File', 'Memory'] | |
.reduce(function (acc, name) { | |
acc[name] = { | |
configurable: true, | |
enumerable: true, | |
get: function () { | |
return libs[name][name]; | |
} | |
}; | |
return acc; | |
}, {}) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment