Closed tobeorla closed 6 years ago
On each class you're doing this exports.Server = Server (https://github.com/toajs/quic/blob/master/lib/server.js#L72) which will lead you to set the lib/index.js like:
exports.Server = Server
lib/index.js
exports.Server = require('./server').Server exports.Client = require('./client').Client
So clients can call your library like this:
var quic = new require('quic'); var server = new quic.Server(); server.listen(1029, 'localhost');
¿Wouldn't it be better to set exports = Server?, so index can look like:
exports = Server
exports.Server = require('./server') exports.Client = require('./client')
On each class you're doing this
exports.Server = Server
(https://github.com/toajs/quic/blob/master/lib/server.js#L72) which will lead you to set thelib/index.js
like:So clients can call your library like this:
¿Wouldn't it be better to set
exports = Server
?, so index can look like: