Skip to content
This repository was archived by the owner on Dec 19, 2025. It is now read-only.
This repository was archived by the owner on Dec 19, 2025. It is now read-only.

Feature request: cleanup and relaunch #47

Open

Description

@bywo

Hi there, thanks for maintaining this awesome tool. It's a great way to reduce recompile times.

I'm trying to do something a little out of the ordinary. I'd like to have my dev server and my tests share the same in-memory ts-node compiler so I can quickly switch between running tests and playing with my dev server while making changes to my source files.

I'd also like to reuse ts-node-dev because you've already solved the main problem of hooking into require for transpilation and file watching. I believe I can achieve this by making it possible for ts-node-dev clean up after itself via a programmatic API.

What I mean is this:

const start = require("ts-node-dev/lib/index.js")
let dispose = start("my-server.ts");
...
dispose(); // filewatcher and child process get killed, but ts-node compiler sticks around
dispose = start("my-tests.ts"); // second `start()` call doesn't re-init compiler
...
dispose(); 

What do you think? If you're okay with this functionality, I can open a PR. Thanks!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions