Closed balupton closed 10 years ago
Doesn't seem like it is there yet:
https://github.com/joyent/node/issues/4138
The other issue here is that we will need to use a synchronous exec to install the extension, as utilities and customs need to be installed right away.
However there is:
https://github.com/tvcutsem/harmony-reflect
Which shims the crappy node harmony methods with the latest working ones.
Using the above with:
node --harmony
var p = new Proxy(require('chainy').create(), {get:function(target, name){ return target[name] || 'fetch '+name } })
p.done // chainy done
p.asd // fetch asd
Works fine. However... it does require the --harmony
flag, which is a major pain.
So now just need to figure out exec sync, possible options until node 0.12 is release with exec sync by default:
Closing. Autoloading the installed plugins solves this issue in a different way.
The problem with autoloading is it requires the extensions to be installed, it would be nice if there was a proxy thing plus the autoinstall plugin.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/noSuchMethod could be an option for this
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy#Very_simple_example
http://wiki.ecmascript.org/doku.php?id=harmony%3aproxies#simulating_nosuchmethod_doesnotunderstand