I'm looking for a Javascript code generation library that is written in Javascript. I've used CodeModel in Java - https://codemodel.dev.java.net/ - and was hoping to find something similar (or better) for Javascript.
What I'm trying to do is create a visual programming environment where a user would drag and drop blocks to generate Javascript code. If anyone has used the LEGO Mindstorm IDE from a few years ago, I want to basically duplicate that but for Javascript.
I tried Googl'ing but the results are completely overwhelmed by SEO spam and things to generate buttons.
Edit: added an explanation of what I'm trying to accomplish.
Are you looking to generate code because you want to write a DSL (or full language) and have it spit out valid JavaScript? Jison (http://zaach.github.com/jison/) does that.
If you're looking for code generation just because you're coming from Java and think you need to generate code because everything is so complex and that simple tasks require 5+ classes, each implementing more interfaces than that, and… well, you're in luck. JavaScript is much simpler than that. Welcome to modern languages. :-)