owhat-job
Version:
owhat红包清理
26 lines (17 loc) • 538 B
JavaScript
;
var fs = require("fs");
function CreateFile(jsonData, toPath, callback) {
var str = JSON.stringify(jsonData, null, "\t");
fs.writeFile(toPath, str, callback);
}
function CreateFileSync(jsonData, toPath) {
var 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;