javascript - Making my web app running a node script after some event -


so, have code on node-script.js :

fs = require('fs'); data = "some stuff";  fs.writefile('data.txt', data, function (err) {   if (err) return console.log(err);   console.log('hello world > data.txt'); }); 

and idea run after user clicked on button. user input data , store data in 'data' variable , write file. how can make index.js run outside script?


Comments

Popular posts from this blog

python - Installing PyDev in eclipse is failed -

PHP OOP-based login system -

c# - Nested Internal Class with Readonly Hashtable throws Null ref exception.. on assignment -