You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for the query. I would strongly advise against using this project and i may be marking it as deprecated in future. Please, know, the compiler used in this project is typescript 0.9.0 (pre 1.0), with the most recent typescript compiler being typescript 2.4.2 (as of writing).
If you are looking to convert typescript into javascript programmatically, the current approaches i know of are listed below.
run the tsc compiler module as a child_process (async) with node. (recommended)
opening up the modern typescript compiler source and writing a new programmatic interface (which is what this project attempted way way back)
I has been a long time since i have looked at the compiler, but it may be more conducive to developing a programmatic interface than it had been. So its worth taking a look. (something i may do in future)
In terms of compiling sync, it may be possible, but not in this project. the reason is that this project supports resolving typescript modules over http, and fetching things over http is inherently async. But with this in mind, i do encourage you to consider async for your tasks as the compiler can halt other processing happening in your application.
I would perhaps also encourage you to explore what is available on npm outside this project, there may be other similar projects available today :)
is there a way for converting typescript to javascript programmatically(sync way?)
The text was updated successfully, but these errors were encountered: