I am wondering if there is a way to add a folder to Favorites using Node?
I've found this issue, but the solution does not work anymore.
Basically the file that I'm interested in is located in:
/Users/USER_NAME/Library/Application\ Support/com.apple.sharedfilelist
The thing is I do not know how to modify it...
You can use try os
module. Very easy to use.
Here is an example:
const home = require("os").homedir(); // This will get your OS based Home directory
const dirToSave = `${home}/Desktop/output.csv`; // Now you can add file or folder to any tree directory of home directory.
fs.writeFile(`${dirToSave}`, {csvData}, function(err, stat) {
if (err) throw err;
console.log("file saved");
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With