diff --git a/examples/sync-mod.js b/examples/sync-mod.js new file mode 100755 index 0000000..50071f7 --- /dev/null +++ b/examples/sync-mod.js @@ -0,0 +1,7 @@ +#!/usr/bin/env node +var Y = require('./sync-module'); + +Y.YQL('select * from github.user.info where (id = "davglass")', function(r) { + //Do something here. + Y.log(r.query, 'debug', 'yql'); +}); diff --git a/examples/sync-module.js b/examples/sync-module.js index 050bf3c..3d18f82 100755 --- a/examples/sync-module.js +++ b/examples/sync-module.js @@ -2,8 +2,6 @@ var YUI = require("yui3").YUI; -YUI.loadSync = true; - YUI({ filter: 'debug', _logExclude: { @@ -16,7 +14,7 @@ YUI({ 'event': true }, debug: true -}).use('yql', function(Ysync) { +}).useSync('yql', function(Ysync) { module.exports = Ysync; diff --git a/lib/node-yui3.js b/lib/node-yui3.js index 8a3d356..c574649 100644 --- a/lib/node-yui3.js +++ b/lib/node-yui3.js @@ -258,6 +258,11 @@ YUI.prototype.fetch = function(url, o) { }; +YUI.prototype.useSync = function() { + YUI.loadSync = true; + return this.use.apply(this, arguments); +} + YUI.prototype.__use = YUI.prototype.use; YUI.prototype.use = function() {