fidm / quic

[DEPRECATED, recommended https://github.com/nodejs/quic] A QUIC server/client implementation in Node.js
MIT License
131 stars 13 forks source link

Point classes directly to export #5

Closed tobeorla closed 6 years ago

tobeorla commented 7 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 = 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 = require('./server')
exports.Client = require('./client')