Code Monkey home page Code Monkey logo

js2js's Introduction

About the project

There are dozens of tools that compile some programming language to JavaScript. You can do it with C++, Java, C#, Python, Scala or Ruby. But there's one language that remains to be covered for JavaScript to dominate the world: JavaScript.

We did it. Meet js2js, a revolutionary compiler that transforms JavaScript directly to JavaScript!

Features

  • Control. You have full control over every single bit of the code produced by js2js. You can even compile an invalid JavaScript program to an equally invalid one.
  • Zero overhead. js2js will never slow you down. The compiled code has exactly the same performance as the original input.
  • Integration. js2js rocks with any other JavaScript technology out there: AngularJS, Emscripten, Vanilla JS, jQuery, CoffeeScript, TypeScript, and even Dart.
  • Cross-platform. js2js-powered code supports all kinds of stationary and mobile devices and Web browsers. Even if you develop for Netscape 2.0, we've got you covered.

Usage

For first-time usage, fetch the dependencies:

$ cd js2js
$ npm install

To compile your code, use the following command:

node js2.js -i <input_file_or_directory> -o <output_file_or_directory>

Interesting fact: you can compile the code of js2js with js2js and everything will work as expected. Check this out:

>node js2.js -i js2.js -o js2.compiled.js -v
Welcome to js2js compiler.
Compiling js2.js...
Output is written to: js2.compiled.js
Done!

Options

  • --decompile: decompile js2js-powered JS back to original JS.
  • --force: overwrite existing files in the destination location.
  • --verbose: toggle detailed output.

Technology

js2js is written in JavaScript and runs on Node.js. It is also available as an NPM package: js2js.

How can I contribute?

You can fork the project, make your changes and send us pull requests. Or just share it with your friends and make some JavaScript fun together with js2js.

js2js's People

Contributors

danhper avatar fidian avatar kt3k avatar nemecec avatar variousauthors avatar victorhaydin avatar yuriyguts avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

js2js's Issues

Grunt Plugin?

I'd like to incorporate this into my grunt workflow. Any timeline on a grunt plugin for this?

WONT UNZIP

Tried to unzip with JZip and no archives willunzip

Asynchrony

It would be great if js2js had asynchronous methods as well as your current synchronous ones.

Decompiler?

I've accidentally deleted some original JavaScript source files after compiling to JavaScript. Would be great to have a --decompile option to get them back, thanks!

Doesn't work?

I'm compiling nodejs code, but it doesn't work, output as follows:

js2js -i xScan -o xScanc -v
/usr/local/bin/js2js: line 1: use strict: command not found
: command not founds: line 1:
: command not founds: line 2:
/usr/local/bin/js2js: line 3: syntax error near unexpected token (' 'usr/local/bin/js2js: line 3:var OP = require('OptionParser');

js2js questions

Hello js2js Team,

I'm developing a serious cutting-edge application for a large enterprise. The application will store millions of records and will have very low response time. I'm planning to use jQuery plugins to show animations to the users. My app will have facebook, instagram and twitter integration.

Is your tool compatible with this kind of software and mobile screen resolutions? Could you please provide me a step-by-step tutorial and a downloadable example how can I do all of this with js2js?

PS: I have short time to deliver the software, so if I don't get any help, I have to use other tools from your competitors.

Thank you!

Discovering new possibilities: it even works for php

I was as amazed as most reactions on this repo. So I started exploring more possibilities. I found out that with minor adjustments, this goddess of a tool could also compile php2php!!!
Are you thinking about releasing a version that does that?

Compiler and compressor?

I read all the code, and this interesting idea. But all that is being done is returned the same code in Javascirpt, exactly the same. I wonder if that was the goal?

Well if so, it would be interesting generale option to compress the code. And other options?

unit tests

converting js to js is tricky... how about some tests?

node: command not found

My executive bumped into my office today to show me your awesome compiler.
But he has an error when using the compiler. It says node: command not found.

Can we help my executive and embed nodejs into JS ?

Thank you so much for your hard work.

No NPM module available

There's no NPM module with this awesome functionality available.
Could you please register one?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.