Package Exports
- auto-launch
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (auto-launch) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
node-auto-launch
Launch applications or executables at login (Mac, Windows and Linux). Perfect for NW.js and Electron apps. Also handles Electron updates on Windows so the correct version of your app is launched when using the auto updater.
Notes
- Node V4 or greater is required.
- With v3.0 the ES6-Promise dependency has been removed. This module automatically overwrote Promise in the global namespace. If upgrading to v3 check to make sure this will not affect your project.
Installation
npm install auto-launch
Usage
The API consists only of enable, disable, and isEnabled.
var AutoLaunch = require('auto-launch');
var minecraftAutoLauncher = new AutoLaunch({
name: 'Minecraft',
path: '/Applications/Minecraft.app',
isHidden: true
});
minecraftAutoLauncher.enable();
//minecraftAutoLauncher.disable();For NW.js or Electron apps you don't have to specify the path. It gets read from process.execPath :)
var AutoLaunch = require('auto-launch');
var appLauncher = new AutoLaunch({
name: 'My NW.js or Electron app'
});
appLauncher.isEnabled().then(function(enabled){
if(enabled) return;
return appLauncher.enable()
}).then(function(err){
});Note: I added a method (removeNwjsLoginItem) to remove 'nwjs helper' app login item that might have been added to peoples accounts since the name change from node-webkit to NW.js.
TODO:
- Add
getCurrentPath- So you can check if the app has moved around.