xdg-apps

1.1.0 • Public • Published

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.

Package Sidebar

Install

npm i xdg-apps

Weekly Downloads

24

Version

1.1.0

License

none

Unpacked Size

33.5 kB

Total Files

33

Last publish

Collaborators

  • klepthys
  • yanndub