How to use EncloseJS

404 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 answers

3
FreedomPride 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