node.js - how can I write file to windows system folder? -
i want add new fonts windows system folder electron, failed, how this? here code can work in app folder.i want put file in 'c:\windows\fonts', thank u.
var request = http.get("http://www.mysites.com/newfont.ttf", function(response) { if (response.statuscode === 200) { var file = fs.createwritestream("app/font.ttf"); response.pipe(file); } });
in error can see http not defined, tell you forget require
http
module. way have same thing fs
module no ?
Comments
Post a Comment