node package manager

Introducing npm Enterprise add-ons. Integrate third-party dev tools into npm…


a Sequelize.js strategy for eccies.js


A ectypes strategy for Sequelize.js -

Ectypes can be found at

npm install ectypes-sequelize

Calls to build() and create() on a Sequelize model are supported.

First, create the Sequelize connection and configure it on the ectypes-sequelize strategy. Then load the strategy into ectypes.

var ectypes = require('ectypes');
var sequelize = new Sequelize('ectypes_test', 'nicholas', null);
var ectypesSequelize = require('ectypes-sequelize').setup(sequelize);

Once you have defined an ectype for your model:

//the Sequelize model definition
var Project = sequelize.define('Project', {
  title: Sequelize.STRING,
  description: Sequelize.TEXT
//the ectype for the Project model
var projectType = {
    Project: {
        title: function(){ return Faker.Name.findName() }

You may then call build() or create() upon it through ectypes to produce the object.

    console.log(, project.title);  //this logs something like 6 'Autumn Medhurst' (using Faker)

Use hooks to model associations.

            Project: {
                title: function(){ return Faker.Name.findName() },
                description: function(){ return Faker.Lorem.findSentences() },
                _hooks: [ 'add a task to a project', function(project, functionName){
                    if (functionName === 'create'){
                            project.task = task;
    project =;
mocha --ignore-leaks tests/ectypes-sequelize-test.js 

This library was made while working at Moneytribe -