Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

updating node compat.js to includel load.

  • Loading branch information...
commit 68b66f4d76819e32aa1c3c749ea7cd93eaa0a507 1 parent be62e9b
@iros iros authored
View
2  dist/miso.events.0.0.1.js
@@ -1,5 +1,5 @@
/**
-* Miso.Events - v0.0.1 - 11/14/2012
+* Miso.Events - v0.0.1 - 11/16/2012
* http://github.com/misoproject/events
* Copyright (c) 2012 Alex Graul, Irene Ros;
* Dual Licensed: MIT, GPL
View
2  dist/miso.events.deps.0.0.1.js
@@ -4175,7 +4175,7 @@
}
}(this));
/**
-* Miso.Events - v0.0.1 - 11/14/2012
+* Miso.Events - v0.0.1 - 11/16/2012
* http://github.com/misoproject/events
* Copyright (c) 2012 Alex Graul, Irene Ros;
* Dual Licensed: MIT, GPL
View
2  dist/miso.events.deps.min.0.0.1.js
@@ -1,5 +1,5 @@
/**
-* Miso.Events - v0.0.1 - 11/14/2012
+* Miso.Events - v0.0.1 - 11/16/2012
* http://github.com/misoproject/events
* Copyright (c) 2012 Alex Graul, Irene Ros;
* Dual Licensed: MIT, GPL
View
2  dist/miso.events.min.0.0.1.js
@@ -1,5 +1,5 @@
/**
-* Miso.Events - v0.0.1 - 11/14/2012
+* Miso.Events - v0.0.1 - 11/16/2012
* http://github.com/misoproject/events
* Copyright (c) 2012 Alex Graul, Irene Ros;
* Dual Licensed: MIT, GPL
View
18 dist/node/miso.events.0.0.1.js
@@ -1,7 +1,7 @@
var _ = require("lodash");
/**
-* Miso.Events - v0.0.1 - 11/14/2012
+* Miso.Events - v0.0.1 - 11/16/2012
* http://github.com/misoproject/events
* Copyright (c) 2012 Alex Graul, Irene Ros;
* Dual Licensed: MIT, GPL
@@ -129,5 +129,21 @@ var _ = require("lodash");
}(this, _));
+// Load function that makes Miso plugin loading more formal.
+this.Miso.load = function(moduleName) {
+ try {
+ // Attempt to load from node_modules
+ require(moduleName);
+ } catch (ex) {
+ // If path is not already full qualified prefix with cwd
+ if (!path.existsSync(moduleName)) {
+ moduleName = path.resolve(process.cwd(), moduleName);
+ }
+
+ // Load the correct module
+ require(moduleName);
+ }
+};
+
// Expose the module
module.exports = this.Miso;
View
16 src/node/compat.js
@@ -2,5 +2,21 @@ var _ = require("lodash");
<%= content %>
+// Load function that makes Miso plugin loading more formal.
+this.Miso.load = function(moduleName) {
+ try {
+ // Attempt to load from node_modules
+ require(moduleName);
+ } catch (ex) {
+ // If path is not already full qualified prefix with cwd
+ if (!path.existsSync(moduleName)) {
+ moduleName = path.resolve(process.cwd(), moduleName);
+ }
+
+ // Load the correct module
+ require(moduleName);
+ }
+};
+
// Expose the module
module.exports = this.Miso;
Please sign in to comment.
Something went wrong with that request. Please try again.