sucrase-node 623 B

123456789101112131415161718
  1. #!/usr/bin/env node
  2. const Module = require("module");
  3. const {resolve} = require("path");
  4. /*
  5. * Simple wrapper around node that first registers Sucrase with default settings.
  6. *
  7. * This is meant for simple use cases, and doesn't support custom Node/V8 args,
  8. * executing a code snippet, a REPL, or other things that you might find in
  9. * node, babel-node, or ts-node. For more advanced use cases, you can use
  10. * `node -r sucrase/register` or register a require hook programmatically from
  11. * your own code.
  12. */
  13. require("../register");
  14. process.argv.splice(1, 1);
  15. process.argv[1] = resolve(process.argv[1]);
  16. Module.runMain();