Skip to main content

调用 node 执行 js,可指定编码,支持异步返回

Project description

介绍

调用 node 执行 js ,可指定编码格式
支持异步调用,只要你调用的函数会返回结果就会正常返回

安装

pip install -U gexecjs

示例

    # run_js = RunJs(filepath='test.js')
    run_js = RunJs(content='''
        function getCookie(){
            return arguments
        }
    ''')
    result = run_js.run('getCookie', 'Gk')
    print(result)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gexecjs-0.0.3.tar.gz (3.0 kB view details)

Uploaded Source

File details

Details for the file gexecjs-0.0.3.tar.gz.

File metadata

  • Download URL: gexecjs-0.0.3.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.2

File hashes

Hashes for gexecjs-0.0.3.tar.gz
Algorithm Hash digest
SHA256 b05c720a02d809a60a2f297538d8a4847273dedb51fb12e15067fc8354cdb90f
MD5 cef22538ad2772e99c3ebd8ff6d8e21b
BLAKE2b-256 42f0e80ddc73cf377e73660c802eab9c4226a8089371ebda5aecd6cf91a60e8f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page