In node js there is a module called as vm, this module is used to call javacsript functions both server side and client side at a time. Install vm module by using "npm install vm" .
If want to use vm module also install fs module. fs module is used to read the file. Install fs module by using "npm install fs" .
var fs = require('fs'); var vm = require('vm'); vm.runInThisContext(fs.readFileSync(__dirname + "/public/controllers/globalCalls.js")); console.log(ShowAttachmentName('ekg'));
You might also like:
|Example for Conditional Operator in php 16-04-2017 php Conditional Operator example|
|Sanitization in java sript 14-03-2017 sanitization java script|