Js2Py icon indicating copy to clipboard operation
Js2Py copied to clipboard

JavaScript to Python Translator & JavaScript interpreter written in 100% pure Python🚀 Try it online:

Results 140 Js2Py issues
Sort by recently updated
recently updated
newest added

### Overview In file: [__init__.py](https://github.com/PiotrDabkowski/Js2Py/blob/master/js2py/translators/__init__.py#L22), `__all__` includes undefined symbols `Node`,`WrappingNode`,`node_to_dict`, `translate`. This will cause an `ImportError` when importing the module using star import i.e. `from js2py.translators import *`. ### Possible...

# Overview When using CryptoJS to encode non-ASCII characters, the resulting encrypted output cannot be decrypted properly. ```python import js2py CryptoJS = js2py.require('crypto-js') print(CryptoJS.AES.encrypt("你好世界!", "test").toString()) ``` ![image](https://github.com/user-attachments/assets/42ae38ce-f09b-4bf9-b2b1-bb2953b94953) # Problem During...

I have long obfuscated code in obfuscated_code.js **var _0xc46e=[\"\",\"split\",\"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/\",\"slice\",\"indexOf\",\"\",\"\",\".\",\"pow\",\"reduce\",\"reverse\",\"0\"];function _0xe51c(d,e,f){var g=_0xc46e[2][_0xc46e[1]](_0xc46e[0]);var h=g[_0xc46e[3]](0,e);var i=g[_0xc46e[3]](0,f);var j=d[_0xc46e[1]](_0xc46e[0])[_0xc46e[10]]()[_0xc46e[9]](function(a,b,c){if(h[_0xc46e[4]](b)!==-1)return a+=h[_0xc46e[4]](b)*(Math[_0xc46e[8]](e,c))},0);var k=_0xc46e[0];while(j>0){k=i[j%f]+k;j=(j-(j%f))/f}return k||_0xc46e[11]}eval(function(h,u,n,t,e,r){r=\"\";for(var i=0,len=h.length;i

"C:\Program Files\Python313\python.exe" D:\Python\web-scraper\test\CasService\DES.py Traceback (most recent call last): File "D:\Python\web-scraper\test\CasService\DES.py", line 1, in from js2py.pyjs import * File "C:\Users\Skyler\AppData\Roaming\Python\Python313\site-packages\js2py\__init__.py", line 72, in from .base import PyJsException File "C:\Users\Skyler\AppData\Roaming\Python\Python313\site-packages\js2py\base.py", line 6,...

Очень нужно использовать JS с DOM. Можно как то фейково его загрузить? И если нет, могете посоветовать библиотеки подобные с поддержкой DOM?

[This return statement](https://github.com/PiotrDabkowski/Js2Py/blob/2e017b86e2f18a6c8a842293b1687f2ce7baa12e/examples/pyesprima.py#L2603) will swallow any in-flight exception. If the `try` block raises an exception which is not of type `PyJsException` (such as a `KeyboardInterrupt`), or the `except` block raises...

Hi, Is it possible to use Js2py.translate_file() to translate node.js source code to .py and then install it using python and after that use node.js to run JavaScript files embedded...

Thanks for building this really cool library! I noticed the following. ``` # python: int(float(255120250923013158)) == 255120250923013152 js2py.eval_js("String(255120250923013158)") == 255120250923013152 // JavaScript: String(255120250923013158) == "255120250923013150" ```

I wanted to abort JS code with time-limit. Here is the approach I tried. Please suggest if there better way. ```python import queue import threading import js2py import ctypes """...