Skip to content

Find the best app to open a file / thumbnailize it according to XDG Specifications

License

Notifications You must be signed in to change notification settings

Holusion/node-xdg-apps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 :

Other values wont throw an error but will produce undefined results.

About

Find the best app to open a file / thumbnailize it according to XDG Specifications

Resources

License

Stars

Watchers

Forks

Packages

No packages published