const fileSave = require('file-save') fileSave('./1.js') .write(`var a = 1;`, 'utf8') .write(`var b = 2;`, () => { console.log('写入回调'); }) .end('\n') .finish(() => { console.log('写入完成'); });
生成的文件内容:
var a = 1;var b = 2;
标签:console,log,nodejs,file,var,save From: https://www.cnblogs.com/fanqieyuanzi/p/16791166.html