Freedesktop Destop Entry
This package allows you to read and write Desktop Entry files.
With this package you can;
- serialize the opened Desktop Entry files to JSON.
- make changes to entry file
- overwrite the orginal file or save to another location
- preserve comments
constructor
JSON.parse(JSON.stringify(value))
is used to clone passed object.
let obj = "Desktop Entry": "comment": "inline comment" "precedingComment": "preceding multiline comment" "second line" "entries": "Type": "value": "Application" "comment": "" "precedingComment": "Name": "value": "Foo Viewer" "comment": " inline comment" "precedingComment": "precedingComment of an entry" "Exec": "value": "fooview %F" "comment": "" "precedingComment": "Icon": "value": "fooview" "comment": "" "precedingComment": let desktopEntry = obj;let desktopEntry = "/usr/share/applications/DesktopEntry.desktop";
get JSON
console;
setValue
"Categories=Network;WebBrowser" => "Categories=Game"
desktopEntry
addValue
Adds value to entry: "Categories=Network;WebBrowser" => "Categories=Network;WebBrowser;Game"
desktopEntry
setComment
desktopEntry
setPrecedingComment
desktopEntry
save
Returns a promise
desktopEntry
saveTo
Returns a promise
desktopEntry
Used some parts of code from node-file-parser