owhat-job
Version:
owhat红包清理
29 lines (16 loc) • 526 B
JavaScript
var fs = require("fs");
function CreateFile(jsonData, toPath, callback) {
let str = JSON.stringify(jsonData, null, "\t")
fs.writeFile(toPath, str, callback);
}
function CreateFileSync(jsonData, toPath) {
let str = JSON.stringify(jsonData, null, "\t")
fs.writeFileSync(toPath, str);
}
function ReadFileSync(path) {
var result = JSON.parse(fs.readFileSync(path));
return result;
}
exports.CreateFile = CreateFile;
exports.CreateFileSync = CreateFileSync;
exports.ReadFileSync = ReadFileSync;