JavaScript is a scripting language used mainly for frontend development in web applications, but it has also gained popularity recently in server-side solutions with Node.js.
JavaScript code generated by the Apache Thrift compiler (Node.js aside) is strictly client-side, intended to be used in the web browser against the services written in other languages.
Apache Thrift's compiler offers few options for JavaScript. Run the following command to see them:
$ thrift --help
Look for the information about JavaScript generators:
js (Javascript): jquery: Generate jQuery compatible code. node: Generate node.js compatible code. ts: Generate TypeScript definition files.
Running the generator without any options will provide you with just plain JavaScript code. Let's explain the extra options:
Jquery
: The generated code will be jQuery compatibleNode
: Code for Node.js will be generated; technically, this is still JavaScript code...