An easy way to manage startup apps in NodeJS.
• Fix Disable function not working
• Improve performance
• Return proper ResultObject
• And more bug fixes!
npm i startup-manager
⚠ 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'));
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) |
Name | Format |
---|---|
ResultObject |
{ failed: Boolean, error: null | Error } |
StatusObject |
{ exists: Boolean, status: 'ENABLED' | 'DISABLED' | 'UNKNOWN' | null } |