Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support all node CLI flags #12

Closed
blakeembrey opened this issue Sep 18, 2015 · 11 comments
Closed

Support all node CLI flags #12

blakeembrey opened this issue Sep 18, 2015 · 11 comments
Assignees
Labels
enhancement you can do this Good candidate for a pull request.

Comments

@blakeembrey
Copy link
Member

Should be able to enable things like --harmony from ts-node --harmony script.ts. Good place to start: https://github.com/babel/babel/blob/master/packages/babel-cli/src/babel-node.js

@blakeembrey blakeembrey self-assigned this Sep 18, 2015
@blakeembrey blakeembrey added enhancement you can do this Good candidate for a pull request. labels Sep 18, 2015
@mgechev
Copy link

mgechev commented Oct 7, 2015

May be tsc flags such as --experimentalDecorators as well?

@blakeembrey
Copy link
Member Author

That's probably doable, but it is already possible using tsconfig.json.

@neomantra
Copy link

I'm personally interested in passing the --debug flag to node. Would you accept a PR for that or are you more interested in a general solution?

On the general side, rather than fancy auto-detect that Babel did there, how about something blindly forwards user specified options on the generated node command, e.g. --forwardOption --debug.

@blakeembrey
Copy link
Member Author

@neomantra yes, I'm perfectly happy with that - that would be my preferred solution.

@danielnaab
Copy link

@blakeembrey Thanks, I was just looking for this feature today, and see it was just pushed yesterday with 0.9.2. But it's not clear to us it - is it documented somewhere?

@blakeembrey
Copy link
Member Author

@danielnaab ts-node --debug script.ts

@danielnaab
Copy link

@blakeembrey Hmm, I had tried ts-node --harmony_default_parameters script.ts. Should that work? With that form I get the REPL instead of the script executed.

@blakeembrey
Copy link
Member Author

You're right, sorry. Looks like the functionality is a little broken because of https://github.com/TypeStrong/ts-node/blob/master/src/_bin.ts#L72. We might need to invert that check and consider every argument that's a string as a string and treat the rest as boolean.

@blakeembrey
Copy link
Member Author

Either that, or have the first bin script (https://github.com/TypeStrong/ts-node/blob/master/src/bin.ts) strip out the node arguments it finds first before passing them along.

@blakeembrey
Copy link
Member Author

@danielnaab Fixed it with e9c7012. Update to 0.9.3 and try again.

@danielnaab
Copy link

@blakeembrey Excellent, thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement you can do this Good candidate for a pull request.
Projects
None yet
Development

No branches or pull requests

4 participants