Effective clean way to initialize Sequelize as an object

Sequelize is an ORM for Node.js that I have decided to use in a project. I, like most of my fellow programmers, generally like cleaner code and in this case I found a pretty damn good way to initialize it and keep the initializing functions separate from rest of the code. Further, I structured it so that it was very easy to use it as well.

To use this code you would simply do something like:

This is how you use that, this is a bit complicated because it’s from an actual application:

Comments (1)

  1. Sami K. (reply)

    October 5, 2012 at 5:24 am

    I updated the existing entry with some more example code about how you might try using this.

Leave a Reply

Your email address will not be published. Required fields are marked *

Published on: 6 March 2012
Posted by: Sami K.
Discussion: 1 Comment
Tags: , ,