UNPKG

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