Home:ALL Converter>Call minified browser javascript in node

Call minified browser javascript in node

Ask Time:2017-10-19T01:38:58         Author:user3071643

Json Formatter

I have an enormous minified javascript file (with no browser specific calls) but several functions that I need to use. Is there a systematic way to convert such a file so that it is callable in node? The js is wrapped in a self executing anonymous function. The function ends with .call(this)

Author:user3071643,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/46816093/call-minified-browser-javascript-in-node
Fenton :

The very least you would need to do is export something from that file, so you could load it as a module and consume it from your other Node code.\n\n exports.myThing = somethingFromMyFile;\n",
2017-10-18T17:40:50
yy