title: Best practie to require a module within Sails.js globally?
body: <p>I am currently building out the Authentication piece of my Sails.js app, using <code>bcrypt</code> to hash my passwords. Everything is working well, here is a sample of the implementation thus far:</p>
  
  <pre><code>beforeCreate: function (values, next) {
  
      require('bcrypt').hash(values.password, 10, function passwordEncrypted(err, encryptedPassword) {
  
          if (err) return next(err);
  
          values.password = encryptedPassword;
          next();
  
      });
  
  }
  </code></pre>
  
  <p>Now, both in my <code>model</code> and in my <code>controller</code>, I am using <code>require('bcrypt')</code> or <code>var bcrypt = require('bcrypt');</code> so I can use it within my class.</p>
  
  <p>I am looking for a better practice way of defining <code>var bcrypt = require('bcrypt');</code> once and globally so that I can simply use the <code>bcrypt</code> variable whenever I need to (inside other models or controllers).</p>
  
  <p>I am inclined to believe that Sails.js already has something in place for that? If not, what do you suggest the best route of implementation? In the end, I am looking for best practice.</p>
  
  <p>Thanks in advance!</p>