It's generally preferable not to do this unless you really need to. Integrating with JavaScript adds a lot of complexity, makes error handling more difficult, and potentially harms performance. There are a few cases where it still makes sense to do this; for example, there are packages that run JavaScript-based syntax analyzers that it would be unreasonable to port.

Emmet is an example of doing it very badly. It bundles an entire JavaScript runtime, but it uses it for basic text-editing functionality that could be accomplished just as well or better in Python. Emmet is a very common source of bugs; whenever completions aren't working for someone, the first question is always whether they've installed Emmet, and uninstalling it often fixes the problem.

If you're talking about the Remix IDE, it doesn't look like it has any kind of real API. You'd probably be better off working from the underlying tools (e.g. solc). Rather than trying to bundle solc with your package, you should rely on end users to have solc installed.