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

Call repomix from within a node script #297

Closed
buesing opened this issue Jan 19, 2025 · 2 comments
Closed

Call repomix from within a node script #297

buesing opened this issue Jan 19, 2025 · 2 comments

Comments

@buesing
Copy link

buesing commented Jan 19, 2025

Hi, I would like to use repomix in my application. Is it possible to call repomix as a node library, as opposed to a command line tool? If so, is there documentation on that somewhere? Thank you!

@yamadashy
Copy link
Owner

Hi, @buesing !
Thank you for your interest in Repomix!

Yes, it is possible to use Repomix as a Node.js library. There's actually a similar feature request that we're tracking here: #257.

Currently, you can use Repomix programmatically like this:

import { pack } from "repomix";

// Basic usage
await pack("path/to/directory", config);

However, I should note that the current library interface isn't as clean as we'd like it to be since it still heavily relies on console output through the logger system. We're planning to provide a more developer-friendly in the future with better interfaces and error handling.

@buesing
Copy link
Author

buesing commented Jan 19, 2025

Very cool! Thanks a lot for the quick response, I'll close this issue in favor of the other one.

@buesing buesing closed this as completed Jan 19, 2025
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