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
Post a Comment