New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

aiappkit

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aiappkit

Manages a local application process, starting it when needed and stopping it after inactivity

latest
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

Spawn Apps

A utility for managing local application processes, starting them when needed and stopping them after inactivity.

Features

  • Start and stop applications with a single line of code

  • Automatically manage process lifecycle

  • Set custom timeouts for auto-shutdown

  • Register custom applications with OS-specific paths

  • TypeScript support with type definitions

  • Cross-platform support (macOS, Windows, Linux)

TypeScript Setup

This project is now written in TypeScript. The build process generates JavaScript files and TypeScript declaration files (.d.ts) in the dist directory.

To build the project:

  • Install dependencies:

    npm install
    
  • Build the TypeScript code:

    npm run build
    

    This will compile the TypeScript files to JavaScript in the dist directory.

  • Run the example:

    npm run start:example
    

Alternatively, you can run the build script which handles all of the above:

./build.sh

Development

  • Run in watch mode to automatically recompile on changes:

    npm run dev
    
  • Clean the build directory:

    npm run clean
    

Usage

After building, you can import the library from the dist directory:

import { startApp, stopApp } from "./dist/index.js";
// Or when installed as a package:
// import { startApp, stopApp } from "spawn-apps";

// Start an application with arguments (returns a Promise)
await startApp("Desktop Crawler", ["--headless", "--firecrawl-headless"]);

// Your application code here...

// Stop the application when done
stopApp("Desktop Crawler");

API Reference

startApp(appName: string, args: string[] = [], timeout: number = DEFAULT_TIMEOUT): Promise<boolean>

Starts an app with the given arguments and sets an auto-shutdown timeout.

stopApp(appName: string, timeout: number = 0): boolean

Stops the app immediately or schedules a stop after the specified timeout.

registerApp(appName: string, options: AppOptions): void

Registers a new app with the registry, specifying bundle ID and OS-specific paths.

License

MIT

Keywords

process

FAQs

Package last updated on 25 Mar 2025

Related posts