xdg-apps
v1.1.0
Published
![](https://github.com/Holusion/node-xdg-apps/workflows/test/badge.svg)
Downloads
22
Readme
node-xdg-apps
Find the best app to open a file / thumbnailize it according to XDG Specifications
npm install xdg-apps
Usage
Find the right app to open a file
var Finder = require("xdg-apps");
var finder = new Finder();
finder.find("/path/to/my/file",function(err,launcher){
//DO SOMETHING
});
//OR
finder.find("/path/to/my/file").then(function(launcher){
//DO SOMETHING
}).catch(function(e){
//ERROR
});
If you want to really open the file afterward, take a look at desktop-launch.
Find a list of system apps
var Finder = require("xdg-apps");
var finder = new Finder();
finder.apps.list().then(function(apps){
//An array of parsed desktop entries
}).catch(function(e){
//Handle errors
})
Options
finder takes only one parameter : the type of apps we want to search for. Possible values :
- desktop for desktop entries (default)
- thumbnailer for thumbnails Specification
Other values wont throw an error but will produce undefined results.