MCPcopy Create free account
hub / github.com/anilkumarum/mark-clipper / appendToFile

Function appendToFile

common/file.js:19–31  ·  view source on GitHub ↗
(filePath, data)

Source from the content-addressed store, hash-verified

17}
18
19export async function appendToFile(filePath, data) {
20 if (!data) return;
21 const enteries = filePath.split("/");
22 const fileName = enteries.pop();
23 const utf8Buffer = encode(data);
24
25 try {
26 await filePath.write(utf8Buffer);
27 await filePath.close();
28 } catch (error) {
29 toast(error);
30 }
31}
32
33/**@param {string} attachmentUrl*/
34export async function writeAttachmentFile(attachmentUrl, filePath) {

Callers 3

exportAllNotesMethod · 0.90
exportNoteMethod · 0.90
appendCrtTabLinkFunction · 0.90

Calls 1

encodeFunction · 0.90

Tested by

no test coverage detected