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:
parent
da928f20a2
commit
591824dd0c
9 changed files with 136 additions and 80 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue