Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/holusion/node-xdg-apps
Find the best app to open a file / thumbnailize it according to XDG Specifications
https://github.com/holusion/node-xdg-apps
Last synced: 29 days ago
JSON representation
Find the best app to open a file / thumbnailize it according to XDG Specifications
- Host: GitHub
- URL: https://github.com/holusion/node-xdg-apps
- Owner: Holusion
- License: mit
- Created: 2015-10-13T12:38:08.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2022-12-30T17:49:28.000Z (almost 2 years ago)
- Last Synced: 2024-04-24T22:21:44.362Z (8 months ago)
- Language: JavaScript
- Size: 110 KB
- Stars: 3
- Watchers: 7
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# node-xdg-apps
![](https://github.com/Holusion/node-xdg-apps/workflows/test/badge.svg)
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](https://github.com/Holusion/node-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](http://standards.freedesktop.org/desktop-entry-spec/latest/) **(default)**
- thumbnailer for [thumbnails Specification](http://specifications.freedesktop.org/thumbnail-spec/thumbnail-spec-latest.html)Other values wont throw an error but will produce undefined results.