The built in REPL module lets you call a callback asyncronously: https://nodejs.org/api/repl.html#repl_custom_evaluation_functions You should expose the callback somehow so that async operations can take place.