Is there a way to read compiled JS as a string from within Reason at runtime?


#1

Is it possible to consult the Bucklescript compiler to ask for the generated javascript code as a string? Some like the following code from javascript:

let obj = { f: function f() { let stuff = “hi”; console.log(“hi”); } };
let code = obj.f.toString();
console.log(code);


#2

#3

That looks incredibly simple! I’ll try it out now and see how it goes!