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:
|How to use request module in node js 16-03-2017 request module node js|
|Remove last two characters from given string using slice 07-03-2017 slice remove|
|Filter for insert HTML in Angular Js 06-03-2017 filter show html angular js html|
|Filter for change Date format (MM-dd-yyyy) in Angular Js 05-03-2017 mm-dd-yyyy date formats angular js|