Finally! A way to hide your Javascript.
Introducing SauceJs.

SauceJs is a library and system for moving your javascript functions out of the client side and away from prying eyes.
SauceJs was inspired by Firebase and relies on the Q library for promise asynchronous callbacks to a NodeJS server.


View on GitHub

Benefits of SauceJs :

  • The secret sauce of your applications are no longer visible to the world.
  • The foot print of your client side code is dramatically reduced.
  • Your codebase can be converted with only small modifications.
  • SauceJs can be used from a non AngularJS application or as an AngularJS factory.

Demo 1

If the value of 'Test' is more than 0 and the "Status" is not 'waiting...', than SauceJs is working with your browser.



Test = 0
Status = waiting...

Source

This is a really basic example but as you can see, the code does not rely on AngularJS and the semantics of the functions are not visible to you.


var test = function test(){
  z_._(arguments);
}
test('test1',$('#test1').html());
              


Demo 2

This is an example of SauceJs being used in AngularJs. It leverages an AI algorithm based on the strategy described here http://demo.ksankaran.com/tictactoe/index.html


GAME OVER - {{winmessage}}
{{column.letter}}
Status : {{status}}


Source

The source below (or in this documents source) will not help you figure out how the AI in this tic tac toe is soo good at beating you.


var ttt = angular.module('tttApp', ['sauce']);
function TicTacToeCntl($scope, z_) {

  // You can access SauceJs by using the z_._() function, for 
  // individual functions, or z_._SecretSauce() for a list of 
  // functions.

  (function setup(){
    return z_._('/sauce',arguments,$scope);
  })();
  
  z_.SecretSauce('/sauce',['markUserClick', 'markTheOne', 'fillTheEmptySpot', 'isCornerSpot', 'getInFork',
              'targetCorner', 'playAtEmptySpot', 'checkWin', 'checkDraw', 'setUserTurn', 
              'think', 'startGame','test2'], $scope);
  $scope.test2();
};
              


Other SauceJs Demos:

  • coLab : A collaborative list and ranking board.




Please excuse the 'pre' level of this demo page and the SauceJs library. I just put it together over the Thanksgiving weekend as a personal challenge to find a new way to make javascript code more secure and private. If you have any questions or comments, reach out on Hacker News, or via twitter.
@StonlyBaptiste