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.4.tar.gz (3.1 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for gexecjs-0.0.4.tar.gz
Algorithm Hash digest
SHA256 e335c3041ebf13d1983658b4492077e57e729aae056088fc401cfe11fadb8076
MD5 9aa3da3f3ac2779d848a14bb596cee25
BLAKE2b-256 ad4ceceb61defbee9095ecebb5f61be14668b222c77c69ffe55a6d4959f29361

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