How to use EncloseJS

416 Views Asked by At

i have script test.js with content

console.log('Hello, this is EncloseJS test.');

Later will be in this file some function or other important code.

I compile it with enclose js like enclose test.js -o test.bin

Now, i need exec it in my javascript application. I tried something like require('test.bin') or eval('test.bin'); but i think, it is not right way.

Can someone hel me? Thanks.

1

There are 1 best solutions below

3
On

You could try this way:

var exec = require('child_process').exec;
var cmd = 'path/to/test.bin';

exec(cmd, function(error, stdout, stderr) 

Never tried it , but do give me a feedback