Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run as a module #1

Open
olawalejuwonm opened this issue Jun 13, 2024 · 3 comments
Open

Run as a module #1

olawalejuwonm opened this issue Jun 13, 2024 · 3 comments

Comments

@olawalejuwonm
Copy link

Is there a possibility of running this as part of application without necessarily using it as a global cli program?

Great work 👏 overall

@sepiropht
Copy link
Owner

Of course you can, if you have a use case.
You can use it as npm module I think

@olawalejuwonm
Copy link
Author

olawalejuwonm commented Jun 13, 2024 via email

@sepiropht
Copy link
Owner

sepiropht commented Jun 13, 2024

lib.mjs:

Contains the core logic with the getAudio and getSubtitles functions.
These functions are exported so they can be used in other files.

cli.mjs:

Handles the command-line interface (CLI) logic.
Imports the core functions from lib.mjs and calls them based on the CLI arguments.

index.mjs:
import function from lib.mjs and export them. The cli and your application will came here to load the module

You can do a pr if you want to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants