Skip to content

NexovaDev/startup-manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

versionweekly_downloadsdownloadsissueslicensestartup-manager

Startup Manager

An easy way to manage startup apps in NodeJS.


Changelog (v1.1.0)

• Fix Disable function not working
• Improve performance
• Return proper ResultObject
• And more bug fixes!


Installation

npm i startup-manager

Usage

This library is ONLY compatible with node version 14 and above! Only supports Windows at the moment

First, you must import the library using the following code:

const StartupManager = require('startup-manager');
// or `import * as StartupManager from 'startup-manager';` for ESM users


You can use the following functions with this library, more usage info available in the parameters section

const StartupManager = require('startup-manager');
// or `import * as StartupManager from 'startup-manager';` for ESM users

// Creates the startup key
console.log(StartupManager.Create('SomeAppName', 'C:\\Path\\To\\App\\app.exe', ['--SomeArgument']));

// Returns the status as an object
console.log(StartupManager.Status('SomeAppName'));

// Disables the startup key
console.log(StartupManager.Disable('SomeAppName'));

// Should return { exists: true, status: 'DISABLED' }
console.log(StartupManager.Status('SomeAppName'));

// Enables the startup key
console.log(StartupManager.Enable('SomeAppName'));

// Should return { exists: true, status: 'ENABLED' }
console.log(StartupManager.Status('SomeAppName'));

// Delete the startup key
console.log(StartupManager.Delete('SomeAppName'));

// Should return { exists: false, status: null } now
console.log(StartupManager.Status('SomeAppName'));

Parameters

Parameters info for all of the functions

Function Parameters Description Return value
Create name: string, path: string, args: string[] Creates an enabled startup key ResultObject (object)
Delete name: string Deletes a startup key ResultObject (object)
Enable name: string Enables a disabled startup key ResultObject (object)
Disable name: string Disables a enabled startup key ResultObject (object)
Status name: string Gets the status of a startup key StatusObject (object)

Objects

Name Format
ResultObject { failed: Boolean, error: null | Error }
StatusObject { exists: Boolean, status: 'ENABLED' | 'DISABLED' | 'UNKNOWN' | null }