version of the jsapp

23 views
Skip to first unread message

Daniel Mascena

unread,
Feb 5, 2011, 11:38:33 PM2/5/11
to JSApp.US
Hai,

i'm trying to execute some examples in the jsapp using the Node
v0.3.0 api, but it's raising some error like missing methods. I'm
wondering what is the version of node used by the jsapp's sandbox,
thanks...

Matthew Francis-Landau

unread,
Feb 6, 2011, 12:28:45 AM2/6/11
to jsap...@googlegroups.com
JSApp.us is running on the latest version of the 0.3.x branch, 0.3.8 at time of writing.  I am assuming that the problems that you are experiencing is due to the fact that jsapp uses a sandbox, where most of the node api is modified to work in the safety of the sandbox.  I have tried to make everything that is not supported by jsapp, but listed in the node docs throw an error and warn of its absents.  
You might want to checkout: https://github.com/matthewfl/node-host/blob/master/sandbox/modules.js as it contains the base for the interface of the base modules provided.  If there is some module that is not being properly warned about being absent, let me know so I can add it, or fork it and add it in.  

Matthew Francis-Landau

Daniel Mascena

unread,
Feb 6, 2011, 9:12:42 AM2/6/11
to jsap...@googlegroups.com
Thanks Matthew for this informations.. could you tell me if there is a reference api for the sandbox? Another doubt is how can I load a module from my  virtual file system, i'm trying through "require('./myModule.js')", but didn't work out.

2011/2/6 Matthew Francis-Landau <matthewm...@gmail.com>



--
Atenciosamente

Daniel A. A. Mascena

Matthew Francis-Landau

unread,
Feb 6, 2011, 2:20:25 PM2/6/11
to jsap...@googlegroups.com
Yes you should be able to reference files from your local file system using ./file-name.js, Note that this will not search for files, so you will have to use an exact name.

Something that will not work on jsapp with the require is using a variable name, and not a string in require, for example:
var a = "./some-file-name1.js";
var b = require(a); // this will not work
var c = require("./some-file-name2.js"); // this will work

There is a sorta hackish way to get around this, but I am not recommending it.


Daniel Mascena

unread,
Feb 8, 2011, 8:01:08 PM2/8/11
to jsap...@googlegroups.com

thanks Matthew for all the information, i'll give a shot... see ya

sent from Android

Em 06/02/2011 16:20, "Matthew Francis-Landau" <matthewm...@gmail.com>escreveu:

Yes you should be able to reference files from your local file system using ./file-name.js, Note that this will not search for files, so you will have to use an exact name.

Something that will not work on jsapp with the require is using a variable name, and not a string in require, for example:
var a = "./some-file-name1.js";
var b = require(a); // this will not work
var c = require("./some-file-name2.js"); // this will work

There is a sorta hackish way to get around this, but I am not recommending it.




On Feb 6, 2011, at 6:12 AM, Daniel Mascena wrote:

> Thanks Matthew for this informations.. could ...

Reply all
Reply to author
Forward
0 new messages