1
0
Fork 0
mirror of https://github.com/pawelmalak/flame.git synced 2025-07-19 11:39:36 +02:00

Fetch and use custom search queries

This commit is contained in:
unknown 2021-10-06 14:15:05 +02:00
parent da928f20a2
commit 591824dd0c
9 changed files with 136 additions and 80 deletions

View file

@ -3,7 +3,7 @@ const fs = require('fs');
class File {
constructor(path) {
this.path = path;
this.content = '';
this.content = null;
}
read() {
@ -16,10 +16,13 @@ class File {
}
}
write(data) {
write(data, isJSON) {
this.content = data;
fs.writeFileSync(this.path, this.content);
fs.writeFileSync(
this.path,
isJSON ? JSON.stringify(this.content) : this.content
);
}
}
module.exports = File;
module.exports = File;