Skip to content

create-a-container: Depend directly on Authentication and do not invoke as cli #53

@runleveldev

Description

@runleveldev

Issue: Replace CLI invocation of Node script with direct module import and function call

Description:
The current implementation executes a Node.js script as a separate process:

const runner = spawn('node', ['/root/bin/js/runner.js', 'authenticateUser', username, password]);

This approach treats a JavaScript file as a command-line tool rather than a reusable module.

Recommendation:
Refactor runner.js to export its functions and import it directly where needed, for example:

const { authenticateUser } = require('/root/bin/js/runner');
authenticateUser(username, password);

Benefits:

  • Eliminates unnecessary process spawning overhead
  • Improves performance and error handling
  • Enables direct access to function results and exceptions
  • Simplifies testing and maintenance

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions