seanemmer / mongoose-seed

Seed data population for Mongoose
MIT License
52 stars 33 forks source link

Connect to return promise. #30

Open Johannestegner opened 6 years ago

Johannestegner commented 6 years ago

Pull request contains updates mainly to the connect method, no breaking changes. If callback is not included in call to connect a Promise is created and returned.

A few minor additional adjustments have been made:

I added a STATES object which is just a map for the mongoose.connection.readyState values (only changed value in the connect code though (for now)) and also changed the in-parameters of the connect method and added JSDocs for it.

This does not fully solve #12, but it's a start.