add method toJs on each node and generate Javascript