title: How to create custom methods or functions inside imported models in Sequelize
body: <p>I am totally a newbie to <code>Node.js</code>. It's my first project in node. Since I use Laravel for most of my projects I am familiar with MVC (Model View Controller).  So I went through the <code>Sequelize ORM</code> documentation regarding Models. I learned how to import one <code>model</code> per file and it worked  but when I added <strong>custom functions</strong> to the <code>User</code> model, the function works fine but doesn't return anything. </p>
  
  <p>Here's my DB File</p>
  
  <pre><code>const fs = require('fs');
  var Sequelize = require('sequelize');
  var sequelize = new Sequelize('database_name', 'userName', 'password', {
    host: 'localhost',
    dialect: 'mysql',
    operatorsAliases: false,
    logging:false,
  
    pool: {
      max: 5,
      min: 0,
      acquire: 30000,
      idle: 10000
    },
  
    // SQLite only
    //storage: 'path/to/database.sqlite'
  });
  
  
  
  sequelize.import('./../models/User.js');
  var db=sequelize.models;
  
  
  
     module.exports={db,connectionCheck};
  </code></pre>
  
  <p>and here's User Model' Code</p>
  
  <pre><code>module.exports = (sequelize, DataTypes) =&gt; {
    var User = sequelize.define('User', {},{
           timestamps: false,
          freezeTableName:true,
          tableName:'agent_info'
        });
  /*This is the custom function that I added*/
        User.test = function(){
           User.findOne().then(data =&gt;{
             console.log(data);
             return data;
          });
        };
  
  
    return User;
  };
  </code></pre>
  
  <p>and finally Route file's code</p>
  
  <pre><code> app.get('/',(req,res,next) =&gt;{
        var temp=db.User.test();
        console.log(temp);
      });
  </code></pre>
  
  <p>Here I am invoking <code>user.test()</code> function (Custom Model Function )
  the function seems to work as expected, but isn't returning anything. So am I doing anything wrong, or it is not possible in Sequelize?
  Thanks in Advance</p>