binding.js 388 B

1234567891011121314151617181920
  1. /*!
  2. * node-sass: lib/binding.js
  3. */
  4. var errors = require('./errors');
  5. /**
  6. * Require binding
  7. */
  8. module.exports = function(ext) {
  9. if (!ext.hasBinary(ext.getBinaryPath())) {
  10. if (!ext.isSupportedEnvironment()) {
  11. throw new Error(errors.unsupportedEnvironment());
  12. } else {
  13. throw new Error(errors.missingBinary());
  14. }
  15. }
  16. return require(ext.getBinaryPath());
  17. };