Skip to content

Support a --require flag #531

Open
Open
@LandonSchropp

Description

@LandonSchropp

I'm submitting a...


[ ] Bug report  
[x] Feature request

Current behavior

Currently, in order to run @babel/node, you have to include a plugin.

Expected behavior

I would like to see a --require flag added to the CLI.

Minimal reproduction of the problem with instructions

N/A

What is the motivation/use case for changing the behavior?

We're now writing all of our JavaScript code using the async/await syntax in our JavaScript. This syntax will eventually be integrated into Node, but for now, we're using Babel. Many Node CLI tools include a --require flag that can be used to load modules directly from the command line, making it easy to add @babel/register to the project. There are also other ES6/ES7 niceties we're using that aren't currently supported by Node, and it's plausible there will be additional ones in the future.

This could be done with a plugin, but it strikes me as unnecessary when there's already a standardized solution to this problem. Plugins also require maintenance. For example, db-migrate-plugin-babel is using the old babel-node instead of the new @babel/register. I'll submit an issue to that project, but that wouldn't be necessary with --register.

Environment


db-migrate version: 0.10.2
db-migrate-pg: 0.2.5

Additional information:
- Node version: 9.2.0
- Platform: Linux (via node Docker image)




---
Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/53403387-support-a-require-flag?utm_campaign=plugin&utm_content=tracker%2F73887&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F73887&utm_medium=issues&utm_source=github).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions