Skip to content

Instantly share code, notes, and snippets.

@wulab
Created June 10, 2021 14:28
Show Gist options
  • Save wulab/27e6b4c57e7fdd835aeb6143c0c575a3 to your computer and use it in GitHub Desktop.
Save wulab/27e6b4c57e7fdd835aeb6143c0c575a3 to your computer and use it in GitHub Desktop.
import * as repl from 'repl';
function myEval(cmd, context, filename, callback) {
callback(null, cmd.trim());
}
function myWriter(output) {
return output;
}
repl.start({ prompt: '> ', eval: myEval, writer: myWriter });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment