Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var write = _.debounce(function() {
steno.writeFile(
filename,
JSON.stringify(object, null, 2),
err => {
if (err) {
console.error(err);
}
}
);
}, 10);
function write(file, json, cb) {
var fileDir = path.join(dbDir, file + '.json');
steno.writeFile(fileDir, JSON.stringify(json, null, 2), function(err) {
if (err) throw err;
});
}
write: function (file, data) {
steno.writeFile(file, data, function (err) {
if (err) throw err
})
},
function save(file) {
const checksum = JSON.stringify(objects[file]);
if (checksums[file] === checksum) return;
checksums[file] = checksum;
const fileDir = path.join(name, file + '.json');
steno.writeFile(fileDir, JSON.stringify(objects[file], null, 2), (err) => {
if (err) throw err;
});
}